on 01-07-2009 4:58 AM
Hi All,
I am working on SAP script in which there is a requirement wherein, I have to fetch values from tables for line items in the Main Window. As per my coding, right now it will fetch only the first value from the table. It is fine if there is only one line item. But if there are more than one line items I need to fetch all the values and display them.
Could anyone suggest any way this can be done.
Thanks
Neha
The correct solution would be to modify the print program to loop through the table and call a text element to print the line.
If you can't modify the print program you could use a series of PERFORMs in the SAPScript, each retrieving a different specific line. This is a bad solution, since you need to create as many PERFORMs as the maximum possible lines in the table for the item.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
IN sapscript
/: PERFORM GET_BILL_PARTNER IN PROGRAM XYZ
/: USING &VBDKL-VBELN&
/: CHANGING &BILL_TO_PART&
/: ENDPERFORM
IN Subroutine program >> XYZ(in SE38)
FORM get_bill_partner TABLES input_table STRUCTURE itcsy
output_table STRUCTURE itcsy.
DATA: lws_vbeln LIKE vbak-vbeln, "Sales Number
lws_kunnr LIKE vbpa-kunnr,
lws_parvw LIKE vbpa-parvw.
Read the input variables.
LOOP AT input_table.
lws_vbeln = input_table-value.
ENDLOOP.
*Add leading zero's to delivery number
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = lws_vbeln
IMPORTING
output = lws_vbeln.
CALL FUNCTION 'CONVERSION_EXIT_PARVW_INPUT'
EXPORTING
input = 'BP'
IMPORTING
output = lws_parvw.
SELECT SINGLE kunnr INTO lws_kunnr
FROM vbpa
WHERE vbeln = lws_vbeln
AND parvw = lws_parvw.
*Pass Ship-To Party value
LOOP AT output_table.
IF output_table-name = 'BILL_TO_PART'. "Description of Shipment
output_table-value = lws_kunnr.
ENDIF.
MODIFY output_table.
ENDLOOP.
I guess this will resolve your question
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 | |
25 | |
12 | |
9 | |
6 | |
6 | |
5 | |
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.