‎2007 Jan 13 4:25 AM
Hi All,
I am trying to populate the ALV Grid shown in the CS12 transaction in a program without calling the transaction ,I have written the code to select the data from the tables , but I am not sure whether it will give all the correct data or not, if some field is missing please suggest from which tables i have to take the data.
SELECT matnr
werks
stlal
stlnr
FROM mast
INTO CORRESPONDING FIELDS OF
TABLE it_mast
WHERE matnr IN p_matnr
AND werks IN p_werks
AND stlal IN p_stlal.
*selecting material description from makt
IF it_mast[] IS NOT INITIAL.
SELECT maktx
FROM makt
INTO CORRESPONDING FIELDS OF
TABLE it_makt FOR ALL ENTRIES IN it_mast
WHERE matnr = it_mast-matnr.
ENDIF.
*
*selecting information about BOM Item from table STPO
IF it_mast[] IS NOT INITIAL.
SELECT menge
postp
meins
aennr
pswrk
stlnr
stlkn
FROM stpo
INTO CORRESPONDING FIELDS OF
TABLE it_stpo FOR ALL ENTRIES IN it_mast WHERE
stlnr = it_mast-stlnr.
ENDIF.
‎2007 Jan 13 4:42 AM
please try to use
CS_BOM_EXPL_MAT_V2 fm it can give you lot of things by passing the header material you can get all the information about BOM.
regards
shiba dutta