02-06-2014 10:03 AM
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?
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
02-06-2014 10:09 AM
Hi,
In
DATA: WERKS type WERKS.
use type WERKS_D, type WERKS is a structure.
Regards,
Jarek
02-06-2014 10:08 AM
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
02-06-2014 10:09 AM
Hi,
In
DATA: WERKS type WERKS.
use type WERKS_D, type WERKS is a structure.
Regards,
Jarek
02-06-2014 10:15 AM
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
02-06-2014 10:44 AM
If You have type conflict ABAP error in runtime error description (tr. ST22) there is Error analysis where name of the structure is mentioned.
02-06-2014 10:55 AM
Chris
The dump will tell you which parameter is declared incorrectly or please attach the dump
Nabheet
02-06-2014 11:09 AM
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...
02-06-2014 11:34 AM
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
02-06-2014 11:38 AM
Put material in inner format. '000-A0000-B00-C00' is outer, use ex. CONVERSION_EXIT_MATN1_INPUT
02-06-2014 12:07 PM
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