0% found this document useful (0 votes)
28 views1 page

No BOM Validation in Sap

The document loops through a table of materials and plants to check if a bill of materials exists for each one. If not, it logs an error message with the material and plant to another table, deletes the entry from the original table, and continues to the next one.

Uploaded by

Farooq Ahmed
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
28 views1 page

No BOM Validation in Sap

The document loops through a table of materials and plants to check if a bill of materials exists for each one. If not, it logs an error message with the material and plant to another table, deletes the entry from the original table, and continues to the next one.

Uploaded by

Farooq Ahmed
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

FORM no_bom_validation .

DATA : lt_mapl TYPE TABLE OF ty_mapl,


lt_mast TYPE TABLE OF ty_mast_stko.
DATA: lv_text TYPE char_132.

DATA: lv_index TYPE syst-index.

lt_mapl[] = gt_mapl[].
lt_mast[] = gt_mast_stko[].

*BREAK-POINT.
LOOP AT lt_mapl INTO gs_mapl .
lv_index = sy-tabix.
READ TABLE lt_mast INTO gs_mast_stko WITH KEY matnr = gs_mapl-matnr
werks = gs_mapl-werks.
IF sy-subrc <> 0 .

CLEAR:gs_output_log.

gs_output_log-matnr = gs_mapl-matnr.
gs_output_log-werks = gs_mapl-werks.

gs_output_log-plnnr = gs_mapl-plnnr.
gs_output_log-plnal = gs_mapl-plnal.

gs_output_log-exec_date = sy-datum.
gs_output_log-exec_time = sy-uzeit.

gs_output_log-type = 'E'.
CONCATENATE 'No BOM Exists for the Material' gs_mapl-
matnr 'plant' gs_mapl-werks INTO lv_text SEPARATED BY ' '.
gs_output_log-message = lv_text.
APPEND gs_output_log TO gt_output_log.
MODIFY zdt_pp_pvers FROM TABLE gt_output_log.
DELETE gt_mapl INDEX lv_index.
DELETE lt_mapl INDEX lv_index.
CLEAR lv_index.

ENDIF.
CLEAR : gs_mapl,
gs_mast_stko.
ENDLOOP.

FREE lt_mast.
FREE lt_mapl.

ENDFORM.

You might also like