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

Parameter ID

Former Member
0 Likes
822


SELECT VBELN BSARK VTWEG SPART VDATU FROM VBAK INTO CORRESPONDING FIELDS OF TABLE ITAB WHERE
 ERDAT IN S_ERDAT
 AND VKORG IN S_VKORG
 AND VTWEG IN S_VTWEG
 AND BSARK IN S_BSARK
 AND SPART IN S_SPART.


AT LINE-SELECTION.
SET PARAMETER ID 'AUN' FIELD ITAB-VBELN.
GET CURSOR FIELD FLD VALUE VAL.
IF FLD = 'ITAB-VBELN'.
WINDOW STARTING AT 20 20 ENDING AT 80 80.
SET PF-STATUS 'ABC'.
WRITE:/1(10) VBAP-MATNR, 12'!', 13(10) VBAP-NETPR, 24'!', 25(12) VBAP-WERKS, 38'!', 39(8) VBAP-KBMENG, 48'!' .
ENDIF.

For a particular sales order number,I want to display the line items for that particular order from vbap for which I have done the coding above,but it doesn't works.Plz suggest the code.

1 ACCEPTED SOLUTION
Read only

naimesh_patel
Active Contributor
0 Likes
646

In this can you can't use the SET PARAMETER ID.

You have to fatch records from VBAP.

AT LINE-SELECTION.
* SET PARAMETER ID 'AUN' FIELD ITAB-VBELN.
* GET CURSOR FIELD FLD VALUE VAL.
IF FLD = 'ITAB-VBELN'.
WINDOW STARTING AT 20 20 ENDING AT 80 80.
SET PF-STATUS 'ABC'.
select matnr netpr werks kbmeng 
into table it_vbap
from vbap
where vbeln = itab-vbeln.
loop at it_vbap
WRITE:/1(10) IT_VBAP-MATNR, 12'!', 13(10) IT_VBAP-NETPR, 24'!', 25(12) IT_VBAP-WERKS, 38'!', 39(8) IT_VBAP-KBMENG, 48'!' .
endloop.
ENDIF.

SET PARAMETER ID is used when you want to set some value for perticular transaction dynmically and then want to call that transaction code.

SET PARAMETER ID 'AUN' FIELD ITAB-VBELN.
CALL TRANSACTION 'VA03' AND SKIP FIRST SCREEN.

Regards,

Naimesh Patel

2 REPLIES 2
Read only

naimesh_patel
Active Contributor
0 Likes
647

In this can you can't use the SET PARAMETER ID.

You have to fatch records from VBAP.

AT LINE-SELECTION.
* SET PARAMETER ID 'AUN' FIELD ITAB-VBELN.
* GET CURSOR FIELD FLD VALUE VAL.
IF FLD = 'ITAB-VBELN'.
WINDOW STARTING AT 20 20 ENDING AT 80 80.
SET PF-STATUS 'ABC'.
select matnr netpr werks kbmeng 
into table it_vbap
from vbap
where vbeln = itab-vbeln.
loop at it_vbap
WRITE:/1(10) IT_VBAP-MATNR, 12'!', 13(10) IT_VBAP-NETPR, 24'!', 25(12) IT_VBAP-WERKS, 38'!', 39(8) IT_VBAP-KBMENG, 48'!' .
endloop.
ENDIF.

SET PARAMETER ID is used when you want to set some value for perticular transaction dynmically and then want to call that transaction code.

SET PARAMETER ID 'AUN' FIELD ITAB-VBELN.
CALL TRANSACTION 'VA03' AND SKIP FIRST SCREEN.

Regards,

Naimesh Patel

Read only

Former Member
0 Likes
646

Where in your coding are you accessing the VBAP table containing the SO line items? You are issuing a WRITE for a number of VBAP fields but I can't see the SELECT from VBAP.