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

Facing problem when adding the code in EXIT_SAPLMEREQ_001

Former Member
0 Likes
2,113

I am using the enhancement 'MEREQ001' to add a custom tab at the PR item level. According to our requirement we need to add 5 fields in that custom tab using the screen 111.

As per documentation, i have added my fields in CI_EBANMEM and design screen 111.

My problem starts after written the below code in EXIT_SAPLMEREQ_001. When i did the syntax check, it showed me error that ci_ebandb_mem is already defined. So, I removed tables staement and checked it again. Then it showed new error that "ci_ebandb_mem is unknown.it is not defined as data staemnt". Then, i thought of doing some more checks by removing the ci_ebandb_mem in both places and did syntax check. This time i got error that "im_req_item is not defined as a data staement". i got suprised and removed the entire code and add only break-point statement. this time i end with error "statement is not accessible".

Based on some experts suggestion, I updated the index present in the environment. nothing helps me out. Finally, I activated the code with error and run the transaction ME51. when i came out of the transaction , it showed run time error "statement is not accessible". Could someone help me out please?


tables: ci_ebandb_mem.
DATA : lv_mereq_item TYPE mereq_item.


IF im_req_item IS INITIAL.
CLEAR: ci_ebandb_mem.
ELSE.
lv_mereq_item = im_req_item->get_data( ).
MOVE-CORRESPONDING lv_mereq_item TO ci_ebandb_mem.
ENDIF.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,478

Hi

This question may look like very strange.

While implementing the function exit,have you double clicked on statement include zxm02u01and then created the include or using SE38.

Sometimes if you create includes using SE38, the system will display 'The statement is not accessible'.

If that is the case then delete the include and recreate by double clicking in SE37 or sometimes by using activate anyway (may work or may not bet)

I have faced this problem many times.

Shiva

6 REPLIES 6
Read only

Former Member
0 Likes
1,478

Hi

If you use TABLES statament, the variable will always be a global data, so you need to declare it/them once.

The best thing si to place the declaration in the top-include,(in your case ZXM02TOP) instead of in an user-exit.

Sometimes it's better to check the fm instead of the include, because the system couldn't see the parameters of the interface (like im_req_item) and you can get that sintax error (but it's not true of course).

Where is "statement is not accessible" shown?

Max

Read only

Clemenss
Active Contributor
0 Likes
1,478

Hi Karthick,

MEREQ001 is used for EXIT_SAPLMEREQ_001. The exit imports reference variable IM_REQ_ITEM which is an object reference for interface IF_PURCHASE_REQUISITION_ITEM.

Except lv_mereq_item you don't need any declarations

The way may be

DATA : 
  lv_mereq_item TYPE mereq_item.
  
IF im_req_item IS bound.
  lv_mereq_item = im_req_item->get_data( ).
  lv_mereq_item-customer_field_1 = 'your value'.
  lv_mereq_item-customer_field_2 = 'your value'.
  lv_mereq_item-customer_field_3 = 'your value'.
  im_req_item->set_data( lv_mereq_item ).
endif.

Regards

Clemens

Read only

Former Member
0 Likes
1,479

Hi

This question may look like very strange.

While implementing the function exit,have you double clicked on statement include zxm02u01and then created the include or using SE38.

Sometimes if you create includes using SE38, the system will display 'The statement is not accessible'.

If that is the case then delete the include and recreate by double clicking in SE37 or sometimes by using activate anyway (may work or may not bet)

I have faced this problem many times.

Shiva

Read only

0 Likes
1,478

Thanks all for your replies.

I have created the include from functional group directly. because of this, An entry made in the one include that ends with 'ZZZ' under the same functional group XM02. I commented the entry and activate both 'ZZZ' and 'U01' include that solves the problem. Now end up with one more question.

i thought i did some mistake in the creation of ZXincude. Because the entry of this particular exit ZX'include' is not available under XM02 functional group. But, the another include under same exit whih i created from project is appearing here. Is it possible to delete the zxinclude and recreate it ? if yes, how to delete it.Just delete from the package directly is fine?

Read only

0 Likes
1,478

Hi

Yes u can delete it by SE38, just a nomral include: have you tried that?

Max

Read only

0 Likes
1,478

Thanks Max..I saw the option. Because of my past experience, thought of getting experts opinion before doing that. Let me try that out and inform you.