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

script

Former Member
0 Likes
350

hi all,

i need to retrive the name1 from lfa1 table using based on this condition....then i need to print that name in script...

(LFA1-NAME1

LIFNR = MARA-MFRNR

MATNR = EKPO-MATNR)

Here i am using subrotines using ITCSY strucure...

So please let me know how i can write a program for that...

reward points will provide..

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
317

Hi,

try this praveen

To call ABAP subroutines from within a form we use the

PERFORM... IN PROGRAM ... statement , the advantage of

using it is that the print program is not required to cahnge and we

can get the new data from the subroutine which is placed in a Z

report . To pass and get the values from th subroutine the

parameters are passed which are of type structure ITCSY.

e.g. /:PERFORM get_date IN PROGRAM zreport

/:USING &SALESORDER&

/:CHANGING &S_DATE&

/:ENDPERFORM

The date &S_DATE& ....

The ABAP Code would be

REPORT zreport.

TABLES ztab.

FORM get_date TABLES in_tab STRUCTURE ITCSY out_tab

STRUCTURE ITCSY .

READ TABLE in_tab INDEX 1.

SELECT some_date FROM ztab WHERE salesorder = in_tab-value.

IF sy-subrc EQ 0.

READ TABLE out-tab INDEX 1.

MOVE ztab-somedate TO out_tab-value

MODIFY out_tab INDEX 1.

ENDIF.

ENDFORM.

In the above code USING is used to pass the value to the

subroutine while changing is used to recieve the value from the subroutine ,for further paramters we can use either USING or

CHANGING .

In the subroutine the type of paramter is always an internal table of type ITCSY irrespective of the value passed.The VALUE field of the internal table is used to fill and recieve the values .

reward if helpful

raam

1 REPLY 1
Read only

Former Member
0 Likes
318

Hi,

try this praveen

To call ABAP subroutines from within a form we use the

PERFORM... IN PROGRAM ... statement , the advantage of

using it is that the print program is not required to cahnge and we

can get the new data from the subroutine which is placed in a Z

report . To pass and get the values from th subroutine the

parameters are passed which are of type structure ITCSY.

e.g. /:PERFORM get_date IN PROGRAM zreport

/:USING &SALESORDER&

/:CHANGING &S_DATE&

/:ENDPERFORM

The date &S_DATE& ....

The ABAP Code would be

REPORT zreport.

TABLES ztab.

FORM get_date TABLES in_tab STRUCTURE ITCSY out_tab

STRUCTURE ITCSY .

READ TABLE in_tab INDEX 1.

SELECT some_date FROM ztab WHERE salesorder = in_tab-value.

IF sy-subrc EQ 0.

READ TABLE out-tab INDEX 1.

MOVE ztab-somedate TO out_tab-value

MODIFY out_tab INDEX 1.

ENDIF.

ENDFORM.

In the above code USING is used to pass the value to the

subroutine while changing is used to recieve the value from the subroutine ,for further paramters we can use either USING or

CHANGING .

In the subroutine the type of paramter is always an internal table of type ITCSY irrespective of the value passed.The VALUE field of the internal table is used to fill and recieve the values .

reward if helpful

raam