2006 Jun 04 2:07 PM
IN SAPSCRIPT I GO OUT TO SE38 AND MAKE THIS CODE
BUT I DONT GET THE VALUE INTO OUT_TAB
LOOP AT OUT_TAB.
CASE OUT_TAB-NAME.
WHEN 'KAWRT'.
<b>OUT_TAB-VALUE = Z_KAWRT</b> .
the debug enter but dont give the data into OUT_TAB-VALUE why>??
WHEN 'KBETR'.
<b> OUT_TAB-VALUE = Z_KBETR.</b>
ENDCASE.
MODIFY OUT_TAB.
2006 Jun 04 2:16 PM
HI,
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& ....
<b>The ABAP Code would be</b>
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 .
See this for more info
http://www.sapfans.com/sapfans/forum/r2all/messages/181.html
Thanks
Sudheer
HI,
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& ....
<b>The ABAP Code would be</b>
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 .
See this for more info
http://www.sapfans.com/sapfans/forum/r2all/messages/181.html
Thanks
Sudheer
2006 Jun 04 2:12 PM
Try to use
MODIFY OUT_TAB index sy-tabix and check.
Regds
Manohar
2006 Jun 04 2:16 PM
HI,
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& ....
<b>The ABAP Code would be</b>
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 .
See this for more info
http://www.sapfans.com/sapfans/forum/r2all/messages/181.html
Thanks
Sudheer
2006 Jun 04 2:17 PM
Put ur breakpoint at the modify statement in the loop.
Check if the modify is being successful.If not then this is the cause of the error.Change it to
modify out_tab index sy-tabix.
if you mean to say that OUT_TAB-VALUE = Z_KAWRT itself is not assigning any value then check if Z_KAWRT is populated.If it is populated then the value should be getting passed.
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |