Application Development 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: 

How to change values after using CS_BOM_EXPL_MAT_V2

syntax
Explorer
0 Kudos

Hi Experts,

I have a problem with my BOM. After using  CS_BOM_EXPL_MAT_V2 i'm sending my subitems of BOM to a function. In this function users can edit subitems of BOM. My problem starts here. I used several function modules to save changed subitems of BOM but i didnt have any result yet. I trıed to use  CS_BC_BOM_CHANGE_BATCH_INPUT and  CSAP_MAT_BOM_MAINTAIN but both failed. Can anyone help me with the function modules? Helps will be rewarded.

1 ACCEPTED SOLUTION

nabheetscn
Active Contributor
0 Kudos

Did you use in the below mentioned order as mentioned in documentation..? What was the error you were getting?

CSAP_MAT_BOM_OPEN
CSAP_BOM_ITEM_MAINTAIN
CSAP_MAT_BOM_CLOSE

6 REPLIES 6

nabheetscn
Active Contributor
0 Kudos

Did you use in the below mentioned order as mentioned in documentation..? What was the error you were getting?

CSAP_MAT_BOM_OPEN
CSAP_BOM_ITEM_MAINTAIN
CSAP_MAT_BOM_CLOSE

0 Kudos

When i use  CSAP_MAT_BOM_OPEN i'm getting Runtime Error because of matnr. The error is :

The function module interface allows you to specify only

fields of a particular type under "MATERIAL".

The field "GS_ITAB-MATNR" specified here is a different

field type

.

i defined my field of  MATNR's component type as MATNR but as see i need to define it as MATNR_BI but when i define it as MATNR_BI i'm getting error on BOM.

0 Kudos

First you need to pass the same type in function modules. Secondly can you please paste what error it gives you.

syntax
Explorer
0 Kudos

I defined another matnr as MATNR_BI. Copied original matnr's value into new matnr and send this field to  CSAP_MAT_BOM_OPEN. When i debug the code my sy-subrc is returning 1.

READ TABLE gt_itab INTO gs_itab INDEX 1.

   gs_itab-matnr2 = gs_itab-matnr.

CALL FUNCTION 'CSAP_MAT_BOM_OPEN'

     EXPORTING

       material               = gs_itab-matnr2

       plant                  = gs_itab-werks

       bom_usage              = gs_itab-stlan

*     ALTERNATIVE            =

*     VALID_FROM             =

*     CHANGE_NO              =

*     REVISION_LEVEL         =

*     FL_NO_CHANGE_DOC       = ' '

*   IMPORTING

*     O_STKO                 =

*     FL_WARNING             =

*   TABLES

*     T_STPO                 =

*     T_DEP_DATA             =

*     T_DEP_DESCR            =

*     T_DEP_ORDER            =

*     T_DEP_SOURCE           =

*     T_DEP_DOC              =

    EXCEPTIONS

      error                  = 1

      OTHERS                 = 2

             .

   IF sy-subrc <> 0.

*    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

*            WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

   ENDIF.

nabheetscn
Active Contributor
0 Kudos

Hi Ismail

Can you please the documentation of this FM.. Please pass the date and other parameters. The documentation also has an example of how to call it.

Please check what values is returned in below parameters to understand the error.

*    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

*            WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

Nabheet

syntax
Explorer
0 Kudos

Hi again Nabheet,

I entered valid_from parameter as todays date and entered change no as 001. When i enter this values my msgid is 29 and msgno is 853. When i comment both lines and try to debug it i'm getting error again. This time msgno is 061.