Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

sap script itcsy structure

Former Member
0 Likes
1,307

hi friends i am entry level guy in sap.

pls help in sap scripts itcsy structure code for any additional addins in standard sap scripts.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
749

check this code:

In form write the following perform.

/: PERFORM AMT_WORDS IN PROGRAM ZRVADOR01.

/: USING &KOMK-FKWRT(I13)&

/: CHANGING &IT_SPELL&

/: ENDPERFORM.

AD Rupees: <AD>&IT_SPELL& only.</>

and write the Form in the print program:

******************************************************************************

FORM amt_words TABLES intab STRUCTURE itcsy outtab STRUCTURE itcsy.

DATA it_spell type table of spell with header line.

read table intab index 1.

**********function module to print amt in words

call function 'ZSPELL_AMOUNT'

exporting

amount = intab-value

currency = sy-waers

filler = ' '

language = sy-langu

importing

in_words = it_spell

*********amt in words to form

read table outtab index 1.

outtab-value = it_spell-word.

modify outtab index 1.

endform. "AMT_WORDS

-kothai

3 REPLIES 3
Read only

Former Member
0 Likes
749

Hi,

See the Attached code for writing the PERFORM in Script and writing the code in SE38 using ITCSY structure and passing the data to script.

REPORT ZMPO1 .

form get_freight tables in_par structure itcsy out_par structure itcsy.

tables: ekko,konv,t685t.

data: begin of itab occurs 0,

ebeln like ekko-ebeln,

knumv like ekko-knumv,

end of itab.

data: begin of itab1 occurs 0,

knumv like konv-knumv,

kposn like konv-kposn,

kschl like konv-kschl,

kbetr like konv-kbetr,

waers like konv-waers,

kwert like konv-kwert,

end of itab1.

data: begin of iout occurs 0,

kschl like konv-kschl,

vtext like t685t-vtext,

kbetr like konv-kbetr,

kwert like konv-kwert,

end of iout.

data v_po like ekko-ebeln.

read table in_par with key 'EKKO-EBELN'.

if sy-subrc = 0.

v_po = in_par-value.

select

ebeln

knumv

from ekko

into table itab

where ebeln = v_po.

if sy-subrc = 0.

loop at itab.

select

knumv

kposn

kschl

kbetr

waers

kwert

into table itab1

from konv

where knumv = itab-knumv and

kappl = 'M'.

endloop.

loop at itab1.

if itab1-kposn <> 0.

select single * from t685t

where kschl = itab1-kschl

and kappl = 'M'

and spras = 'EN'.

iout-vtext = t685t-vtext.

iout-kschl = itab1-kschl.

iout-kbetr = itab1-kbetr.

iout-kwert = itab1-kwert.

append iout.

clear iout.

endif.

endloop.

sort itab1 by kposn.

loop at iout.

sort iout by kschl.

if ( iout-kschl eq 'GSDC' OR

iout-kschl eq 'GSFR' OR

iout-kschl eq 'GSIR' ).

at end of kschl.

read table iout index sy-tabix.

sum.

  • write:/ iout-kschl,iout-vtext,iout-kwert.

out_par-name = 'A1'.

out_par-value = iout-vtext.

append out_par.

out_par-name = 'A2'.

out_par-value = iout-kwert.

append out_par.

endat.

endif.

endloop.

endif.

endif.

endform.

  • IN THE FORM I AM WRITING THIS CODE.

/:DEFINE &A1& = ' '

/:DEFINE &A2& = ' '

/:PERFORM GET_FREIGHT IN PROGRAM ZMFORM_PO1

/:USING &EKKO-EBELN&

/:CHANGING &A1&

/:CHANGING &A2&

/:ENDPERFORM

  • &A1&

  • &A2&

This Code is to be written in the PO form under ADDRESS window.

-


/:DEFINE &A1& = ' '

/:DEFINE &A2& = ' '

/:DEFINE &A3& = ' '

/:DEFINE &A4& = ' '

/:DEFINE &A5& = ' '

/:DEFINE &A6& = ' '

/:PERFORM GET_VENDOR IN PROGRAM ZMFORM_PO

/:USING &EKKO-EBELN&

/:CHANGING &A1&

/:CHANGING &A2&

/:CHANGING &A3&

/:CHANGING &A4&

/:CHANGING &A5&

/:CHANGING &A6&

/:ENDPERFORM

  • &A1&

  • &A2&

  • &A3&

  • &A4&

  • &A5&

  • &A6&

reward points if useful

regards,

Anji

Read only

Former Member
0 Likes
749

IN LAYOUT

/: PERFORM GET_BASE IN PROGRAM Y_GET_BASE

/: USING &EKPO-EBELN&

/: USING &EKPO-EBELP&

/: CHANGING &DUMMY&

/: CHANGING &BASE&

/: ENDPERFORM

IN PROG Y_GET_BASE

TABLES : EKKO, EKPO.

DATA : PONO LIKE EKKO-EBELN.

DATA : POITEM LIKE EKPO-EBELP.

DATA : BASEVAL(10) TYPE P DECIMALS 2.

*DATA : base(10) TYPE p DECIMALS 2.

DATA : BASE(16).

FORM GET_BASE TABLES IN_PAR STRUCTURE ITCSY

OUT_PAR STRUCTURE ITCSY.

READ TABLE IN_PAR WITH KEY 'EKPO-EBELN'.

CHECK SY-SUBRC = 0.

PONO = IN_PAR-VALUE.

READ TABLE IN_PAR WITH KEY 'EKPO-EBELP'.

CHECK SY-SUBRC = 0.

POITEM = IN_PAR-VALUE.

SELECT SINGLE * FROM EKPO WHERE EBELN EQ PONO AND EBELP EQ POITEM.

BASEVAL = EKPO-PEINH * ( EKPO-BRTWR / EKPO-MENGE ).

BASE = BASEVAL.

SELECT SINGLE * FROM EKKO WHERE EBELN EQ PONO.

IF SY-SUBRC NE 0. CLEAR EKKO. ENDIF.

IF EKKO-WAERS EQ 'GBP' OR EKKO-WAERS EQ 'USD' OR EKKO-WAERS EQ 'AUD' OR

EKKO-WAERS EQ 'GRP'.

BASE = BASE / 10.

ENDIF.

    • END .

READ TABLE OUT_PAR WITH KEY 'BASE'.

CHECK SY-SUBRC = 0.

OUT_PAR-VALUE = BASE.

MODIFY OUT_PAR INDEX SY-TABIX.

**MODIFY OUT_PAR INDEX SY-TABIX.

ENDFORM.

REGARDS

SHIBA DUTTA

Read only

Former Member
0 Likes
750

check this code:

In form write the following perform.

/: PERFORM AMT_WORDS IN PROGRAM ZRVADOR01.

/: USING &KOMK-FKWRT(I13)&

/: CHANGING &IT_SPELL&

/: ENDPERFORM.

AD Rupees: <AD>&IT_SPELL& only.</>

and write the Form in the print program:

******************************************************************************

FORM amt_words TABLES intab STRUCTURE itcsy outtab STRUCTURE itcsy.

DATA it_spell type table of spell with header line.

read table intab index 1.

**********function module to print amt in words

call function 'ZSPELL_AMOUNT'

exporting

amount = intab-value

currency = sy-waers

filler = ' '

language = sy-langu

importing

in_words = it_spell

*********amt in words to form

read table outtab index 1.

outtab-value = it_spell-word.

modify outtab index 1.

endform. "AMT_WORDS

-kothai