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: 

Modify the value of parameter RESULT_REF in FM F4_GET_RESULT

former_member193724
Active Participant
0 Kudos

I have coded an implicit enhancement in the FM  F4_GET_RESULT  according to my requirement . But the problem i am facing is to change the original value of the parameter RESULT_REF.  This parameter has been ASSIGNED to <itab> using RESULT_REF->* <itab> and it gets the value of <itab> as soon as <itab> is filled. I have made some modifcation in <itab> , but the changes are not getting reflected on  RESULT_REF. Please let me know where i am going wrong.

Regrds.

Lohit

1 ACCEPTED SOLUTION

matt
Active Contributor
0 Kudos

Go into debug and check that the reference RESULT_REF->* and <itab> really are the same. Also, how have you modified <itab>?

Perhaps you should post your code.

8 REPLIES 8

matt
Active Contributor
0 Kudos

Go into debug and check that the reference RESULT_REF->* and <itab> really are the same. Also, how have you modified <itab>?

Perhaps you should post your code.

0 Kudos

I have added my implicit enhn where i am getting data into a internal table ITAB and then assigning ITAB[] to <itab>.  The <itab> data is changed but RESULT_REF still contains old data.



matt
Active Contributor
0 Kudos

Yes. I understand your problem. But what CODE have you used, precisely?

0 Kudos

My code

  SELECT * FROM (sel_method) INTO TABLE ITAB

  WHERE (where_clause)

  %_HINTS ORACLE '&SUBSTITUTE LITERALS&'.

SORT ITAB BY VKORG VTWEG MATNR WERKS CHARG CLABS VFDAT.

DELETE ADJACENT DUPLICATES FROM ITAB COMPARING VKORG VTWEG MATNR WERKS CHARG CLABS VFDAT.

ASSIGN ITAB[] TO <ITAB>.

I have done this to delete duplicates which was difficult to delete from <itab> .

At this moment i get the data which i need in <itab> but the RESULT_REF still holds the duplicate data .


matt
Active Contributor
0 Kudos

The problem is that ITAB is in one area of memory, and result_ref in another. When you assign ITAB to <itab>, <itab> is no longer the result_ref, it's the ITAB.

Try

<itab> = ITAB[].

Or

INSERT LINES OF ITAB INTO TABLE <itab>.

Or

GET REFERENCE OF itab INTO result_ref.

By the way. ITAB is a terrible name for an internal table! Try giving all your variables meaningful names.

0 Kudos

Thanks Matthew . got the reason where I was going wrong..... and the name ITAB was just for testing purpose ...and that's the best name for testing

Thank You once again..

matt
Active Contributor
0 Kudos

lohit devadiga wrote:

Thanks Matthew . got the reason where I was going wrong..... and the name ITAB was just for testing purpose

OK - just checking!

Former Member
0 Kudos

ITAB is a terrible name for internal table, but a good name for a computing device, like IPAD.