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: 

Type conflict error for FM CS_BOM_EXPL_MAT_V2

Former Member
0 Kudos

Dear Expert,

I have a problem in obtain the result data from FM CS_BOM_EXPL_MAT_V2,

How could i solve the folloiwng issue based on my code?

  • : Type conflict during structure parameter transfer at CALL FUNCTION

DATA : stb type table of stpox.

DATA: matcat type table of  CSCMAT .

DATA: topmat type CSTMAT.

DATA: dstst_flg type CSDATA-XFELD.

DATA: valid_date type datum.

DATA: MATNR type MATNR.

DATA: WERKS type WERKS.

       MATNR = '000-A0000-B00-C00'.

       WERKS = '1234'.

       VALID_DATE = sy-datum.

CALL FUNCTION 'CS_BOM_EXPL_MAT_V2'

     EXPORTING

       auskz                 = ' '

       capid                 = 'PP01'

       datuv                 = valid_date

       emeng                 = '1.000'

       stlan                 = '1'

       mtnrv                 = matnr

       mehrs                 = 'X'

       mmory                 = '1'

       stpst                 = '0'

       werks                 = werks

     IMPORTING

      topmat                 = topmat

"      dstst                 = dstst_flg

    TABLES

       stb                   = stb

       matcat                = matcat

     EXCEPTIONS

       material_not_found    = 4

       no_plant_data         = 8

       no_bom_found          = 12

       no_suitable_bom_found = 16.

BR - Chris

1 ACCEPTED SOLUTION

Jarosław
Active Participant
0 Kudos

Hi,

In

DATA: WERKS type WERKS.

use type WERKS_D, type WERKS is a structure.

Regards,

Jarek

9 REPLIES 9

former_member209818
Active Contributor
0 Kudos

Type conflict for which Structure / Field. Make sure that whatever value you are passing to FM, is having the same data type as that of the FM parameter.

- harshad

Jarosław
Active Participant
0 Kudos

Hi,

In

DATA: WERKS type WERKS.

use type WERKS_D, type WERKS is a structure.

Regards,

Jarek

Former Member
0 Kudos

Hi Expert,

Still no hope....

DATA : stb type table of stpox.

DATA: matcat type table of  CSCMAT .

DATA: topmat type CSTMAT.

DATA: dstst_flg type CSDATA-XFELD.


Do i have any problem in the definition for those internal tables?


BR - Chris

Jarosław
Active Participant
0 Kudos

If You have type conflict ABAP error in runtime error description (tr. ST22) there is Error analysis where name of the structure is mentioned.

0 Kudos

Chris

The dump will tell you which parameter is declared incorrectly or please attach the dump

Nabheet

Former Member
0 Kudos

IF l_line_rtti->type_kind = cl_abap_typedescr=>typekind_string OR

             l_line_rtti->type_kind = cl_abap_typedescr=>typekind_xstring OR

             l_line_rtti->type_kind = cl_abap_typedescr=>typekind_char.

           helper = cl_wdr_conversion_utils=>if_wd_conversion_utils~to_string(

               value            = <line>

               client_converter = client_converter

               is_null          = is_null

               formatting_info  = formatting_info

                  ).

         ELSE.

           RAISE EXCEPTION TYPE cx_wdr_conversion_exception

             EXPORTING

               textid = cx_wdr_conversion_exception=>illegal_type.

         ENDIF.

         IF l_index = 1.

           output = helper.

         ELSE.

           CONCATENATE output cl_abap_char_utilities=>newline helper INTO output.

         ENDIF.

       ENDLOOP.

     WHEN cl_abap_typedescr=>typekind_struct1    "'u'     " structure

     OR   cl_abap_typedescr=>typekind_struct2.   "'v'.    " structure

       IF client_converter IS NOT INITIAL.

         output = client_converter->struct_to_string( value = value typedescr = l_rtti ).

       ELSE.

         RAISE EXCEPTION TYPE cx_wdr_conversion_exception

           EXPORTING

             textid = cx_wdr_conversion_exception=>illegal_type.

       ENDIF.

     WHEN OTHERS.

       RAISE EXCEPTION TYPE cx_wdr_conversion_exception

         EXPORTING

           textid = cx_wdr_conversion_exception=>illegal_type.

   ENDCASE.



the dump tell me i have the error on the line underlined, but i donno what can i do...

Former Member
0 Kudos

Now i am able to get rid of type conflict and conversion error.

But i have new problem:

i have to use RFC to retrieve the BOM information.

My code have no problem when read locally and show exception 3 -  MATERIAL_NOT_FOUND

However, when i use

CALL FUNCTION 'CS_BOM_EXPL_MAT_V2' DESTINATION 'XXX100'

It comes up with exception 9.


CALL FUNCTION 'CS_BOM_EXPL_MAT_V2' DESTINATION 'XXX100'

                         EXPORTING

                         CAPID                       = CAPID

                         DATUV                       = SY-DATUM

                         EMENG                       = 1

                         MEHRS                       = 'X'

                         MTNRV                       = MATNR

                         STLAN                       = '1'

                         WERKS                       = WERKS

                         TABLES

                         STB                         = 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.

* Implement suitable error handling here

                        ENDIF.


Is there any way i can view the reason behind exception 9?


Thanks

BR - Chris

Jarosław
Active Participant
0 Kudos

Put material in inner format. '000-A0000-B00-C00' is outer, use ex.  CONVERSION_EXIT_MATN1_INPUT

Former Member
0 Kudos

Finally i could found out whats the matter with the FM.

for the field

EMENG, the original data type is QUANS .

for use it locally , if you input 1, it could convert to 1.000

However, if you do that i RFC

the 1 will not convert to 1.000 to cause the error as ".000" is missing.

So you have to do EMENG = '1.000' in order to pass the value correctly during RFC.

Thanks all for your help and the topic could be close now.

BR - Chris