Application Development and Automation 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: 
Read only

BOM Function Module

Former Member
0 Likes
1,381

Hai All,

I am using FUNCTION MODULE---- 'CSAP_MAT_BOM_READ' to get the component details of a BOM Header.

I am exporting the input parameters to the func mod as

EXPORTING

material = w_mast-matnr

PLANT = w_mast-werks

bom_usage = w_mast-stlan

ALTERNATIVE = w_mast-stlal

VALID_FROM = v_datum

VALID_TO = v_datum

and getting the details into int tab as

TABLES

T_STPO = i_stpo

But When i execute, the program is being terminated due to a short dump.

The error description is as shown below

*The reason for the exception is:*

*The call to the function module "CSAP_MAT_BOM_READ" is incorrect:*

*In the function module interface, you can specify only*

*fields of a specific type and length under "T_STPO".*

*Although the currently specified field*

*" " is the correct type, its length is incorrect.*

Please Help me in solving this exception....

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,038

Hi,

Check this one

Declare like this,

Data: it_tstp2 TYPE TABLE OF stpo_api02,

it_tstk2 TYPE TABLE OF stko_api02.

CALL FUNCTION 'CSAP_MAT_BOM_READ'

EXPORTING

material = wa_mast-matnr

plant = wa_mast-werks

bom_usage = wa_mast-stlan

alternative = wa_mast-stlal

IMPORTING

fl_warning = fg_warning

TABLES

t_stpo = it_tstp2

t_stko = it_tstk2

EXCEPTIONS

error = 1

OTHERS = 2.

IF sy-subrc = 0.

Endif.

7 REPLIES 7
Read only

Former Member
0 Likes
1,038

the type decalartion for i_stpo should be of type T_STPO

check in the F.M what is the type of T_STPO , declare i_stpo to be of same type ie

data:i_stpo type standard table of "type of T_STPO"

this is simple

Hope it helps

Bhanu

Read only

keerthy_k
Product and Topic Expert
Product and Topic Expert
0 Likes
1,038

Hi kavitha,

I think the table parameter(i_stpo) what u have used is diff frm the one which is there in th Function Module. Please see the table type or the table used there. And declare the same type as in ur code also.

Keerthi.

Read only

Former Member
0 Likes
1,038

Declare T_STPO of type STPO_API02

Data: T_STPO type table of STPO_API02.

Read only

I355602
Product and Topic Expert
Product and Topic Expert
0 Likes
1,038

Hi,

Try passing the same values in se37 (execute FM) and check whether any data is returned in table t_stpo

If the same data is returning some data in se37, then there is some error in your coding part.

Check it once and let me know.

Regards,

Tarun

Read only

Former Member
0 Likes
1,039

Hi,

Check this one

Declare like this,

Data: it_tstp2 TYPE TABLE OF stpo_api02,

it_tstk2 TYPE TABLE OF stko_api02.

CALL FUNCTION 'CSAP_MAT_BOM_READ'

EXPORTING

material = wa_mast-matnr

plant = wa_mast-werks

bom_usage = wa_mast-stlan

alternative = wa_mast-stlal

IMPORTING

fl_warning = fg_warning

TABLES

t_stpo = it_tstp2

t_stko = it_tstk2

EXCEPTIONS

error = 1

OTHERS = 2.

IF sy-subrc = 0.

Endif.

Read only

0 Likes
1,038

I tried ur code, an error message stating 'You are not authorised to display this BOM'

is being displayed.

Read only

0 Likes
1,038

Hi,

Check with other valid BOM or give valid inputs material number, plant, BOM usage and Alternative BOM. check the same BOM in CS03.