We have added search box. Key in SAP issue keyword to search
TopBottom

Announcement: wanna exchange links? contact me at sapchatroom@gmail.com.

[sap-newbies-l] Issue With cs_bom_expl_mat_v2

Posted by Admin at
Share this post:
Ma.gnolia DiggIt! Del.icio.us Yahoo Furl Technorati Reddit

Question from vinraag on Feb 17 at 9:41 PM
I am using this FM to get components of all materials. The issue here is for few materials some of its components are purchased from other plants say. For a particular material produced in plant 1 few assemblies are brought from plant 2....by using this FM I am not able to get the components of other plant...it skips and prints the next level.

LOOP AT i_mast INTO w_mast.
read table it_ZLEINIST1 into wa_ZLEINIST1 with key matnr = w_mast-matnr
.
read table it_makt into wa_makt with key matnr = w_mast-matnr.
READ TABLE IT_MARD INTO WA_MARD WITH KEY MATNR = W_MAST-MATNR.
CALL FUNCTION 'CS_BOM_EXPL_MAT_V2'
EXPORTING
CAPID = 'PP01'
DATUV = SY-DATUM
* EMENG = 'X'
MKTLS = '1'
* MDMPS = 'X'
MEHRS = 'X'
MMORY = '1'
MTNRV = w_mast-matnr
STLAL = w_mast-stlal
STLAN = w_mast-stlan
WERKS = w_mast-werks
TABLES
STB = t_stpox
* MATCAT =
EXCEPTIONS
ALT_NOT_FOUND = 1
CALL_INVALID = 2
MATERIAL_NOT_FOUND = 3
MISSING_AUTHORIZATION = 4
NO_BOM_FOUND = 5
NO_PLANT_DATA = 6
NO_SUITABLE_BOM_FOUND = 7
CONVERSION_ERROR = 8
OTHERS = 9
.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
IF sy-subrc EQ 0.
IF wa_ZLEINIST1-zinqt2 > 0.
WA_FINAL-MATNR = W_MAST-MATNR.
WA_FINAL-zinqt2 = wa_ZLEINIST1-zinqt2.
wa_final-kunag = wa_ZLEINIST1-kunag.
wa_final-maktx = wa_makt-MAKTX.
WA_FINAL-ZDATE = wa_ZLEINIST1-ZDATE.


LOOP AT t_stpox INTO w_stpox.
PERFORM DISPLAY_PLAN.
IF W_STPOX-SOBSL = '50'.
WA_FINAL-IDNRK = W_STPOX-IDNRK.
wa_final-ojtxp = w_stpox-ojtxp.
WA_FINAL-MNGKO = W_STPOX-MNGKO.
WA_FINAL-MEINS = W_STPOX-MEINS.
WA_FINAL-STUFE = W_STPOX-STUFE.
wa_FINAL-WERKS = W_STPOX-WERKS.
WA_FINAL-SLOC = V_PHANTOM.
WA_FINAL-PLAN = V_PLAN.
APPEND WA_FINAL TO IT_FINAL.
CLEAR WA_FINAL.

ELSE.

WA_FINAL-IDNRK = W_STPOX-IDNRK.
wa_final-ojtxp = w_stpox-ojtxp.
WA_FINAL-MNGKO = W_STPOX-MNGKO.
WA_FINAL-MEINS = W_STPOX-MEINS.
WA_FINAL-STUFE = W_STPOX-STUFE.
wa_FINAL-WERKS = W_STPOX-WERKS.
WA_FINAL-SLOC = W_STPOX-LGPRO.
WA_FINAL-PLAN = V_PLAN.
APPEND WA_FINAL TO IT_FINAL.
CLEAR WA_FINAL.
ENDIF.
ENDLOOP.
ENDIF.
ENDIF.

ENDLOOP.
ENDFORM. " GET_DATA
 
Reply to this email to post your response.
 
__.____._
Manage Settings | Unsubscribe | Create FAQ | Send Feedback
  
Copyright © 2014 Ziff Davis, Inc. and message author.
Ziff Davis, Inc. 28 E 28th Street New York, NY 10016
vinraag  
 
View this online
Ask a new question
 
In the Spotlight
Earn Recognition for Your Contributions at Toolbox for IT. Gain Points for Community Achievements

_.____.__

0 comments:

Post a Comment

T r a n s l a t e to your language