on 06-19-2008 11:03 AM
Hi I am using perform to get the data .So for that i am using perform in sap script as follows.
/: PERFORM GET_TEXT IN PROGRAM ZSGTEXT_FORM.
/: USING &RFDUZI01-BELNR&
/: CHANGING &RFDUZI01-SGTXT&.
/: ENDPERFORM
After that in abap program i am writing the code as follows.
REPORT ZSGTEXT_FORM .
tables:bseg.
FORM GET_TEXT TABLES IN_TAB STRUCTURE ITCSY
OUT_TAB STRUCTURE ITCSY.
data: i_BELNR like bsid-XBLNR,
i_xblnr like bsid-xblnr,
,
i_sgtxt type sgtxt.
data: begin of lt_belnr occurs 0,
lv_belnr type BELNR_D,
lv_sgtxt type sgtxt,
end of lt_belnr.
data: v_belnr type belnr_d.
READ TABLE IN_TAB INDEX 1.
WRITE IN_TAB-VALUE TO i_belnr .
READ TABLE out_tab INDEX 1.
select belnr sgtxt from bsid into table lt_belnr where xblnr = i_belnr.
loop at lt_belnr.
*read table lt_belnr index sy-tabix.
move lt_belnr-lv_belnr to v_belnr.
move lt_belnr-lv_sgtxt to out_tab-value.
*
modify out_tab index sy-tabix.
*append out_tab.
endloop.
*read table
endform.
But from the above code i am facing one problem.
If there is only one line item it is working fine,but if there is more than one line item then it is over writing the first vaue with second one how to handle this.
Thanks.
Hi,
As per my knowledge it is not possible to pass the entire table at a time using PERFORM in PROGRAM ,,, USING and CHANGING.
Solutions:
1) If possible do the same thing in the Print Program:
using CONTROL_FORM call element and print in the script
2) if you know the all table entries.: Pass all records at time:
Ex: PERFORM Pxxxx in PROGRAM PROGXXXX
USING <MATNR1>
<MATNR2>
<MATNR3>..............
CHANGING < MAKTX1>
<MAKTX2>
<MAKTX3>............
ENDPERFORM
in program program:
loop at IN_TAB .
case in_tab-name = MATNR1
write the code
case in_tab-name = MATNR1
ENDCASE.
endloop.
Reward if helpful.
Bye
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
U can only transport only one value from your subroutine back to the script. The mistake ur doing is that u are looping and then appending out_tab. when the control goes out of ur subroutine,only the last value would be taken in your script.
Thanks
Nayan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi ,
How to call element in SE38 program.
Append is also not working
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
instead of modify...use append...
instead of overwriting this will append the new record....
Reward points if the above ans is useful...
Edited by: Rudra Prasanna Mohapatra on Jun 19, 2008 12:13 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Mohan,
In SE38 in LOOP ENDLOOP call the text element ELEMENT1.
so every time u pass the BELNR and get SGTEXT and write it down.
/E ELEMENT1
/: PERFORM GET_TEXT IN PROGRAM ZSGTEXT_FORM.
/: USING &RFDUZI01-BELNR&
/: CHANGING &RFDUZI01-SGTXT&.
/: ENDPERFORM
*&RFDUZI01-SGTXT&
Best regards,
raam
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.