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

i want code for this

Former Member
0 Likes
288

4) Create a program to perform the following:

• Accept a ‘Sales document type’ from the user

• Retrieve the details of all the sales documents whose type is same as the user entered type, from the table VBAK.

• Retrieve all the item details for each of these sales documents, from the table VBAP.

• Display the data in the following format:

Sales Doc1 Sales org Distribution channel Division

Sales doc item1 Material

Sales doc item2 Material

Sales doc item3 Material

-


-


-


-


Sales Doc2 Sales org Distribution channel Division

Sales doc item1 Material

Sales doc item2 Material

Sales doc item3 Material

-


-


-


-


1 REPLY 1
Read only

Former Member
0 Likes
258

hi devika,

code for your program run this program with sales document type 'TA'.

TABLES:

vbak,

vbap.

"----


  • Declaring Parameters *

"----


PARAMETERS:

p_type TYPE vbak-auart. " Sales Document Type

"----


  • Declaring Data Objects *

"----


DATA:

t_vbak TYPE TABLE OF vbak,

t_vbap TYPE TABLE OF vbap.

FIELD-SYMBOLS:

<fs_vbak> TYPE ANY TABLE,

<fs_vbap> TYPE ANY TABLE.

SELECT *

INTO CORRESPONDING FIELDS OF

TABLE t_vbak

FROM vbak WHERE auart = p_type.

SELECT *

INTO CORRESPONDING FIELDS OF

TABLE t_vbap

FROM vbap.

ASSIGN t_vbak TO <fs_vbak>.

ASSIGN t_vbap TO <fs_vbap>.

"----


  • Displaying Required Data *

"----


LOOP AT <fs_vbak> INTO vbak .

WRITE:/

vbak-vbeln,

vbak-vkorg,

vbak-vtweg,

vbak-spart.

LOOP AT <fs_vbap> INTO vbap.

IF vbak-vbeln = vbap-vbeln.

WRITE:/

vbap-posnr,

vbap-matwa.

ENDIF.

ENDLOOP.

ENDLOOP.

i think it will be useful for you so reward me .

sandeep patel

Edited by: Sandeep patel on Mar 28, 2008 10:49 AM