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: 

How to read data

Former Member
0 Kudos
123

Hi friends,

I have a requirement, where in i am creating a screen exit for ME51N.I am using MEREQ001 enhancement for this.It is working fine, but i am to get data in to this so as to write any code.For that i am using the function exit EXIT_SAPLMEREQ_001 in that same enhancement(thought of doing export and import).

But the data is declared in this way..

REFERENCE(IM_REQ_ITEM) TYPE REF TO IF_PURCHASE_REQUISITION_ITEM

so now it is having a method GET_DATA in which i have all the parameters required.

can anyone please tell me how to read this data...

Regards,

Thoufique.

1 ACCEPTED SOLUTION

uwe_schieferstein
Active Contributor
0 Kudos
72

Hello Thoufique

You may have a look at my Wiki posting

[Accessing the Inacessible - Local Classes within Global Classes |https://wiki.sdn.sap.com/wiki/display/ABAP/AccessingtheInacessible-LocalClasseswithinGlobalClasses]

and the links mentioned therein.

The direct answer to your question is:


DATA: ls_data    TYPE MEREQ_ITEM.

  ls_data = im_req_item->get_data( ).  " function method call

Regards

Uwe

4 REPLIES 4

uwe_schieferstein
Active Contributor
0 Kudos
73

Hello Thoufique

You may have a look at my Wiki posting

[Accessing the Inacessible - Local Classes within Global Classes |https://wiki.sdn.sap.com/wiki/display/ABAP/AccessingtheInacessible-LocalClasseswithinGlobalClasses]

and the links mentioned therein.

The direct answer to your question is:


DATA: ls_data    TYPE MEREQ_ITEM.

  ls_data = im_req_item->get_data( ).  " function method call

Regards

Uwe

0 Kudos
72

Hi Uwe Schieferstein,

Thanks for your valuable answer.

I also need to get data from method GET_REQUISITION(item data) which is of type IF_PURCHASE_REQUISITION.

(RE_REQUISITION Returning Type Ref To IF_PURCHASE_REQUISITION)

so i wrote

CALL METHOD im_req_item->get_requisition

RECEIVING

re_requisition = re_requisition.

now, If i get in to IF_PURCHASE_REQUISITION and see the methods i have a method called GET_ITEMS and i need to get data from RE_ITEMS parameter which is of type MPUR_REQUISITION_ITEMS,

so i wrote

CALL METHOD re_requisition->get_items

RECEIVING

re_items = re_items.

but the output is coming like this

|

|

MMPUR_REQUISITION_ITEM is a line type and this is again of type IF_PURCHASE_REQUISITION_ITEM.which is where i started.

so this is getting recursive and i am unable to get item data.

can you plese help??

Regards,

Thoufique.

0 Kudos
72

Hi Uwe Schieferstein,

Thanks a lot fo the attachment of your wiki posting.

I was code to do the same in the userexit.But it was throwing me error maessages.

Now i have coded the same in the badi and it is working fine.

Thanks a lot for the help.

Regards,

Thoufique.

0 Kudos
72

Hello Thoufique

You are welcome.

And if my Wiki coding proves to be useful for other people as well that's encouraging as well.

Regards

Uwe