cancel
Showing results for 
Search instead for 
Did you mean: 

itcsy

Former Member
0 Kudos

hi gurus

what is itcsy? what is the use of it ? where and when we have to use it?could u give description with exampls?

Accepted Solutions (0)

Answers (4)

Answers (4)

former_member196280
Active Contributor
0 Kudos

Hi,

ITCSY is a Structure

WIth two Fields-

It is mainly used in SAP Scripts to pass data when the Driver program is not in our control. i.e to pass data from SAP script to an include where we call a subroutine defined in a program-

we use this structure to pass data to and fro from SAP Script to program and vice-versa.

Reward points if useful.

Regards,

Sairam

Former Member
0 Kudos

hi,

ITCSY is a structure with 2 fields- name and value.

It is mainly used in scripts to pass data from driver program to script and vice versa.

In script, when we call a subroutine defined in a program- we use this structure to pass data to and from the script like

it is field value pair structure

like MATNR - 000001111111111111

You write the code in script like

PERFORM get_desc in PROGRAM v_prog
            using    &v_matnr&
            changing &v_desc&.
ENDPERFORM.

In the driver program, you use

form get_desc tables
      INTAB structure ITCSY
      OUTTAB structure ITCSY.
.......
.....
endform.

Hope this helps.

Regards,

Richa

Former Member
0 Kudos

Hi Babu,

Search in <b>SDN with Key - ITCSY.</b> Will get lot of related links.

Could not give you the link so copying the answer given by Arun on the same.

For using routine in the sapscript we have to use itcsy.

i have given a demo pgm for ur reference.

/: PERFORM SUM IN PROGRAM ZPROGRAM

/: USING &VAR1&

/: USING &VAR2&

/: CHANGING &RESULT&

/: ENDPERFORM

In the program(ZPROGRAM), we need to write the form ....

FORM SUM TABLES INTAB STRUCTURE ITCSY

OUTTAB STRUCTURE ITCSY.

data: field1 type i,

field2 type i,

result type i.

TO read the values from the ITAB you have to use this logic.

READ TABLE INTAB WITH KEY NAME = 'VAR1'.

IF SY-SUBRC = 0.

FIELD1 = INTAB-VALUE.

ENDIF.

READ TABLE INTAB WITH KEY NAME = 'VAR2'.

IF SY-SUBRC = 0.

FIELD2 = ITAB-VALUE.

ENDIF.

RESULT = V_FIELD1 + V_FIELD2.

READ TABLE OUTTAB INDEX 1.

IF SY-SUBRC = 0.

OTAB-VALUE = RESULT.

MODIFY OUTTAB INDEX 1 .

ENDIF.

ENDFORM.

Regards.....

Reward points if this helps.

Manish

Former Member
0 Kudos

hi babu,

The structure ITCSY is used in relation with SAPScripts. You can call a Routine in any program in SAPScript.

For eg: if you have a subroutine named ADD_INCOME in a program ZSHAIL_BASIC, you can call the subroutine in SAPScript as follows:

/: PERFORM ADD_INCOME IN PROGRAM ZSHAIL_BASIC

/: USING &var1&

/: CHANGING &var2&

/: ENDPERFORM.

Here the input parameter to the subroutine is var1 and the value returned by the subroutine is var2.

In the program ZSHAIL_BASIC, you have to call the subroutine as

FORM ADD_INCOME TABLES IN_TAB STRUCTURE ITCSY OUT_TAB STRUCTURE ITCSY.

ENDFORM.

IN_TAB is a structure of type ITCSY,which has 2 components, NAME and value.

So in the program, var1(which is sent from SAPScript) , will be stored as IN_TAB-NAME and its value will be in IN_TAB-VALUE. You can utilise the IN_TAB-VALUE and after performing the required operations, the return value should be assigned to table OUT_TAB.

This value can thus be obtained in var2 specified in SAPScript.

For using routine in the sapscript v have to use itcsy.

i have given a demo pgm for ur reference.

/: PERFORM SUM IN PROGRAM ZPROGRAM

/: USING &VAR1&

/: USING &VAR2&

/: CHANGING &RESULT&

/: ENDPERFORM

In the program(ZPROGRAM), we need to write the form ....

FORM SUM TABLES INTAB STRUCTURE ITCSY

OUTTAB STRUCTURE ITCSY.

data: field1 type i,

field2 type i,

result type i.

TO read the values from the ITAB you have to use this logic.

READ TABLE INTAB WITH KEY NAME = 'VAR1'.

IF SY-SUBRC = 0.

FIELD1 = INTAB-VALUE.

ENDIF.

READ TABLE INTAB WITH KEY NAME = 'VAR2'.

IF SY-SUBRC = 0.

FIELD2 = ITAB-VALUE.

ENDIF.

RESULT = V_FIELD1 + V_FIELD2.

READ TABLE OUTTAB INDEX 1.

IF SY-SUBRC = 0.

OTAB-VALUE = RESULT.

MODIFY OUTTAB INDEX 1 .

ENDIF.

ENDFORM.

regards,

seshu.