Skip to Content
0
Former Member
Oct 04, 2005 at 08:56 AM

Program does not work

52 Views

Anyone who understands why my program does not work?

*The programs task: The user write an ordernumber and the system shows information about the order.

*Parameter

PARAMETERS: pa_order TYPE vbak-vbeln,

*Structure

TYPES: BEGIN OF st_order,

vbeln TYPE vbak-vbeln,

audat TYPE vbak-audat,

posnr TYPE vbap-posnr,

matnr TYPE vbap-matnr,

rfsta TYPE vbup-rfsta,

rfstk TYPE vbuk-rfstk,

END OF st_order.

*Internal table and workarea

DATA: it_order TYPE STANDARD TABLE OF st_order,

wa_order LIKE LINE OF it_order.

*Fill the interntable with information

SELECT vbakvbeln vbakaudat vbapposnr vbapmatnr vbuk~rfstk

vbup~rfsta

INTO CORRESPONDING FIELDS OF TABLE it_order

FROM vbak

INNER JOIN vbap

ON vbakvbeln = vbapvbeln

INNER JOIN vbuk

ON vbukvbeln = vbakvbeln

INNER JOIN vbup

ON vbupvbeln = vbapvbeln

AND vbupposnr = vbapposnr

WHERE vbak~vbeln = pa_order.

*Write the information in the internal order

LOOP AT it_order INTO wa_order.

WRITE: / wa_order-vbeln, wa_order-audat, wa_order-posnr,wa_order-matnr, wa_order-rfsta, wa_order-rfstk.

ENDLOOP.