Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

function module behaving abnormally

please help me in this issue. function module is not working.

Here i am passing a material to this function module , then it will return its subcomponents ie sub materials and their bom usage.

The fun module is working fine for all the materials except some materials for example say material 1000000001. But i went to se37 and executed the fun module with the same parameters as given here and passed the material 1000000001. Here the output is comming ie sub materials are comming. But in the program for this material it is not comming. the sy-subrc value after this function module is 1. please tell me why it is not comming in the program but working fine in se37.

my coding and parameters are like this.

LOOP AT itab_final .

CALL FUNCTION 'CS_BOM_EXPL_MAT_V2'

EXPORTING

capid = 'PP01'

datuv = sy-datum

EMENG = 1

mktls = 'X'

mehrs = 'X'

mtnrv = itab_final-matnr

stlal = '1'

stlan = '1'

stpst = 0

svwvo = 'X'

werks = plant_werks

  • VERID = ' '

vrsvo = 'X'

  • IMPORTING

  • TOPMAT =

  • DSTST =

TABLES

stb = itab_return

  • 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 EQ 0. //// here subrc value is 1 for the above material.

LOOP AT itab_return.

///// here i have some coding

ENDLOOP.

ENDIF.

ENDLOOP.

Tags:
Former Member
Former Member replied

Hi,

Please give 01 instead of just 1 in the STLAL field.I think the error is because of this.Just chek once.

Hope it works.

Thanks,

Sandeep.

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question