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: 

Table accessing problem

Former Member
0 Kudos

Hi,

I am doing some modifications in Function Module: ZSHP_VEPVG_SELECT_01 (copy standard).

What I need is to make a simple check to the item category from table VBAP from each document stored in 'CX_SD_ORDER-VEPVG' (VBELN).

I can't do a simple loop to table CX_SD_ORDER because i got the error saying that this CX_SD_ORDER is neither specified under TABLES nor defines as an internal table.

I am doing a loop by this way:

LOOP AT CX_SD_ORDER-VEPVG TRANSPORTING NO FIELDS

WHERE VBELN NE space.

  • w_vbeln = VBELN.

ENDLOOP.

Now what i need is to go to table VBAP and check item category from each document. But the problem is how can i access to VBELN stored in that structure CX_SD_ORDER?

I would appreciate any help.

Thanks

Best regards

1 ACCEPTED SOLUTION

former_member589029
Active Contributor
0 Kudos

In that case you can get the value out of field CX_SD_ORDER-VEPVG directly because it is only a structure not a table. Make sure that the vbeln is passed into the function module correctly (in field VEPVG)

Regards,

Michael

7 REPLIES 7

former_member589029
Active Contributor
0 Kudos

If this is a structure, there will always only be one entry, just access the field directly (CX_SD_ORDER-VEPVG). If you can have more than one entry in that table, what is the exact declaration of CX_SD_ORDER?

Thanks,

Michael

0 Kudos

In the Function Module SHP_VEPVG_SELECT_01 I have this structure defined by:

VALUE(CX_SD_ORDER) TYPE SHP_VL10_SD_ORDER, and i need to access to field VBELN from this structure..

Thanks

Best regards

Former Member
0 Kudos

Please check,

Global data copied or not.

any standard includes are necessary for this FM?

Thanks nad Regards,

former_member589029
Active Contributor
0 Kudos

In that case you can get the value out of field CX_SD_ORDER-VEPVG directly because it is only a structure not a table. Make sure that the vbeln is passed into the function module correctly (in field VEPVG)

Regards,

Michael

0 Kudos

Hi,

I have the field in CX_SD_ORDER-VEPVG[1]-VBELN... But i can't access in my program by writing that.

Thanks

Message was edited by:

thor thor

0 Kudos

CX_SD_ORDER-VEPVG is an internal table so you could loop over it.

data: l_wa_vepvg like line of CX_SD_ORDER-VEPVG.

LOOP AT CX_SD_ORDER-VEPVG into l_wa_vepvg.

"now you can access l_wa_vepvg-VBELN

ENDLOOP.

0 Kudos

Hi Che Eky!

Thanks a lot!!

You resolve my problem.

Thanks and best regards