Friday, December 10, 2010

Integer Type Variable - Sapscript Using Space

Hi Folks,

It seems in SAPScript it will not condense if printing integer type value ,
if need comma separated value e.g 6,000,000 moving the value to char type variable is not a good choice as it will remove the comma in after moving the value .

The trick is put condense character in the SAPscript for e.g

&v_credit_ringgit(C)&

it will condense any empty space even it is integer type value.

Changing Custom Menu Path

To change custom menu path used this tcode

SE43

Thursday, December 9, 2010

ICON In Custom Message

Wonder how to put icon in custom pop up.

1) Select your favorite icon by running RTSXINFO

2) Insert status icon element at your module pool layout

3) Declare the parameter ID . Use this paramete name at you PARAMETER ID at status icon element.

DATA: ICN_WARNING TYPE ICONS-TEXT.

4) AT PBO set you status icon image using function ICON_CREATE , below is the e.g

MODULE SET_ICON OUTPUT.

CALL FUNCTION 'ICON_CREATE'
EXPORTING
NAME = 'ICON_MESSAGE_WARNING'
* TEXT = ' '
* INFO = ' '
* ADD_STDINF = 'X'
IMPORTING
RESULT = ICN_WARNING
* EXCEPTIONS
* ICON_NOT_FOUND = 1
* OUTPUTFIELD_TOO_SHORT = 2
* OTHERS = 3
.
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.


ENDMODULE.

5) END

Wednesday, August 11, 2010

Dynamic Open SQL Eh!

What is Dynamic OPEN SQL ?

Its featured as 'SQL changed' that depend on certain condition, resulted minimize line of code.

Please refer below link for better understanding

DATA: str_where TYPE TABLE OF EDPLINE. " declaring the data for holding the where statement.
CONCATENATE 'NAME LIKE ''' NAMELIKE '%''' INTO str_where.

to be continued..

Wednesday, July 28, 2010

SAPScripts and Smartforms Myth

1) There is gutter at left 0.6cm perhaps ? How to change this ?

2) Smartforms what you see is what you not get , manually print and check to know if its correct or not.

3) Smartforms need to create structure to import customize itab at report program level any tricks to skip this ?

4) Counter technique is invented and used to manage the footer in sapscript ?

5) RKD_WORD_WRAP used in SAPScript to make to two lines output.

6) More to come.. the quest never end ;-)

Thursday, July 22, 2010

Back to Basic : Internal Tables

Below is how to declare internal table using local structures type

'' Declaring local structures
TYPES: BEGIN OF struc_sflight,
carried like sflight-carrid,
connection LIKE sflight-connid,
END OF struc_sflight.


"Declare internal tables
" New declaration techniques dont have header line.
DATA : itabflight TYPE struc_sflight.

" Using work area to process data
DATA: wa_flight LIKE LINE OF itabflight.

Tuesday, June 15, 2010

Convert String to comma separated number value

There is certain time we need to convert a text of number to comma separated figure and concatenate with bracket, there is a function may could help on this

Below is the code snippet. Final output will be (13,000.00).

DATAstrnew(100TYPE C.

PARAMETERS p_betrg LIKE T5G15-AMUNT.

CALL FUNCTION 'HRCM_AMOUNT_TO_STRING_CONVERT'
  EXPORTING
    BETRG p_betrg
*   WAERS = ' '
    NEW_DECIMAL_SEPARATOR '.'
    NEW_THOUSANDS_SEPARATOR ','
    IMPORTING
    STRING strnew
.
CONDENSE strnew.
CONCATENATE '(' strnew ')' INTO strnew.
WRITE:/ p_betrg'After conversion' strnew.

To debug background job

1) SM37
2) Go to the spool
3) Key in jdbg command, press [Enter]