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

How to pass data

ram_sahoo
Participant
0 Likes
2,112

Hi Experts,

i have a requirement to pass data from class instance to variable but i am getting error in this below logic.

DATA: lo_rbitem TYPE REF TO cl_browser_item,

          lo_al_ritem TYPE REF TO cl_gos_al_item,

          g_value    TYPE char10.

LOOP AT it_bitem INTO lo_rbitem.

lo_al_ritem ?= lo_rbitem.

   g_value = lo_al_ritem->gs_lporb-instid.

   SELECT SINGLE vbeln vbtyp vkorg spart vtweg

     FROM vbak

     INTO g_vbak

    WHERE vbeln = g_value

    AND   vbtyp IN (A,C,K,L).

endloop.

Error :-

Class CL_GOS_ATTACHMENTS,Method IF_CMD_HANDLER~EXECUTE_ITEMS_CMD51
Field "GS_LPORB-INSTID" is unknown. It is neither in one of the
specified tables nor defined by a "DATA" statement. .

Anybody can help me.

Thanks,

Ram.

Hi ,

As per your code, Try this code.

DATA: lo_rbitem TYPE REF TO cl_browser_item,

          lo_al_ritem TYPE REF TO cl_gos_al_item,

          g_value    TYPE char10.

CREATE OBJECT lo_rbitem.

CREATE OBJECT lo_al_ritem.

LOOP AT it_bitem INTO lo_rbitem.

lo_al_ritem ?= lo_rbitem.

   g_value = lo_al_ritem->gs_lporb-instid.

   SELECT SINGLE vbeln vbtyp vkorg spart vtweg

     FROM vbak

     INTO g_vbak

    WHERE vbeln = g_value

    AND   vbtyp IN (A,C,K,L).

endloop.

This may solve your issues.

Regards,

Ganesh Lathi

8 REPLIES 8
Read only

Former Member
0 Likes
1,992

Hi Ram,

You have to add Create Object command, Before using any method.

Instantion of the class is missing .

Regards,

Ganesh

Read only

0 Likes
1,992

Hi Ganesh,

How can i add create object command, Can you guide me.

Thanks,

Read only

0 Likes
1,992

Hi ,

As per your code, Try this code.

DATA: lo_rbitem TYPE REF TO cl_browser_item,

          lo_al_ritem TYPE REF TO cl_gos_al_item,

          g_value    TYPE char10.

CREATE OBJECT lo_rbitem.

CREATE OBJECT lo_al_ritem.

LOOP AT it_bitem INTO lo_rbitem.

lo_al_ritem ?= lo_rbitem.

   g_value = lo_al_ritem->gs_lporb-instid.

   SELECT SINGLE vbeln vbtyp vkorg spart vtweg

     FROM vbak

     INTO g_vbak

    WHERE vbeln = g_value

    AND   vbtyp IN (A,C,K,L).

endloop.

This may solve your issues.

Regards,

Ganesh Lathi

Read only

HunorCzaka
Explorer
1,992

Hello,

i assume you have in the importing table "it_bitem" of your method instances of the cl_browser_item, that's mean you don't need to "re" create them.

The problem is, that the member attribute "gs_lporb" which you trying to access, doesn't exists.

Where do you get this variable name?


BR

Hunor Czaka

Read only

0 Likes
1,992

Hi Czaka,

Yes i want this lo_al_ritem->gs_lporb-instid  field data in my variable then i can pass in to vbak select query.Can u help me for this requirement.

Thanks,

Read only

0 Likes
1,992

Hello,

i understand what you are trying to do, but the problem is:

"lo_al_ritem" is a reference of the class CL_GOS_AL_ITEM

The class CL_GOS_AL_ITEM has no attribute called "gs_lporb".

That's why you couldn't access it.


The question is, where did you get this specific attribute name? You need to figure out, what exactly you need to do and where are the information's saved.


BR

Hunor Czaka

Read only

0 Likes
1,992

Hi Czaka,

yes that's correct in class CL_GOS_AL_ITEM attribute is not availabe name of "gs_lporb". but i refered to class  lo_al_ritem TYPE REF TO cl_gos_al_item in this class that name of  attribute is availabe but i am facing same error.

Read only

0 Likes
1,992

Hello,

you are writing the same class twice... please try to think about the problem a bit before asking. The field you want to access doesn't exists. That's the problem.

BR

Hunor Czaka