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

syntax error while using the parameter inside the badi method.

Former Member
0 Likes
617

Hello all ,

I'm writing a code in the badi implementation . The badi is /SAPSLL/CTRL_MM0C_R3 . this badi contains a metthod API_CONTROL_MODIFY.This badi triggers while using MIGO transaction .

It is having the following parameter .

IT_MSEG Importing Type SLLR3_MSEG_T .

SLLR3_MSEG_T is declared as follows.

TYPES: sllr3_mkpf_t LIKE mkpf OCCURS 0,

sllr3_mseg_t LIKE mseg OCCURS 0.

here i have to get the werks value that is populated into IT_MSEG whie doing MIGO .

I have declared a local variable and assigned werks value from the IT_MSEG to the local variable as follows

DATA:l_werks type werks.

l_werks = IT_MSEG-WERKS.

But I'm getting the following error.

"IT_MSEG" is a table without a header line and therefore has no

component called "WERKS".

How should i avoid this error. Please give me sample code on how to avoid this error.

thanks in advance

pavan

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
531

Hi,

Move the row from IT_MSEG into a work area and use it. Declare the workarea of required type.

DATA:l_werks type werks.
read table it_mseg into wa_mseg index 1.
l_werks = wa_MSEG-WERKS.

Regards

Vinod

2 REPLIES 2
Read only

Former Member
0 Likes
531

Hi,

In Badi Occurs 0 will not support. you need to create the Struture first and then create the table according to that structure and the work area for that structure.

Then do the coding .

Hope this might help you to solve your problem.

With Regards,

Sumodh.P

Read only

Former Member
0 Likes
532

Hi,

Move the row from IT_MSEG into a work area and use it. Declare the workarea of required type.

DATA:l_werks type werks.
read table it_mseg into wa_mseg index 1.
l_werks = wa_MSEG-WERKS.

Regards

Vinod