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: 

Issue with PBO PAI for User exit MM06E005

Former Member
0 Kudos

Hi SDNers,

I am working on screen exit for ME21N.

Iam using the user exit MM06E005.

I tried creating a new project for MM06E005 but it is already assigned to LO020 so continued with the same.

I am working on screen exit ie SAPMM06E 0101.

On a new tab has been added to the standard PO with the name 'Customer Data'.

On this i have a check box and a input field.

under the PBO of 0101 i have module Hide_fields and the following code has been wriiten.


loop at screen.
      if screen-name = 'ZSUP_EKCF-CFORMNO'.
        screen-input = 0.     
        modify screen.
      endif.
    endloop.

I requirement is I need to keep the checkbox and the input field disabled when the user enters the Tcode and open the create PO screen.

And then when the user enters a vendor number based a condition i need to enable both the fields.

Now Iam confused where would I write the code because i even the tried the function exit EXIT_SAPMM06E_006 (PBO) and EXIT_SAPMM06E_007 (PAI) for the same non of them are trigerring.

Please help me out with a solutions experts.

Regards,

Ranjith N

18 REPLIES 18

Former Member
0 Kudos

Hi Nambiar,

If you want to control the PBO processing based on vendor number, theen in Inlcude ZXM06TOP of the Function-Pool XM06 define a variable of type lifnr. This include is the global data declaration include.

Then in Function Exit EXIT_SAPMM06E_006 assign I_EKKO-LIFNR to the declared global variable.

Since this variable is declared in global top data declaration portion, the value stored in this variable would be available in both PBO and PAI of the screen 0101.

Then further processing can be done based on the value of this global data.

Let us suppose that the varyable that has been declared in global top data declaration portion is "v_lifnr". Your code would look like


loop at screen.
      if screen-name = 'ZSUP_EKCF-CFORMNO'
      and v_lifnr is initial.
        screen-input = 0.     
        modify screen.
      endif.
    endloop.

Hope this helps.

Regards,

Abhisek.

Former Member
0 Kudos

Hi Abhishek,

I really appreciate your efforts to help me out.

I am not able to get you, Inlcude ZXM06TOP of the Function-Pool XM06.

Regards,

Ranjith N

0 Kudos

Hi Nambiar,

Follow the follwing path.

Once an Enhancment has been adde to a project, Double click on any Function Exit -> GOTO -> Global Data -> Double Click on the Global Data Include -> Declare your global variables here.

The variables that are declared here hold their values as long as the transaction is in process.

Regards,

Abhisek.

Former Member
0 Kudos

Hi Abhishek,

I double clicked on the function-exit EXIT_SAPMMO6E_006.

Then GOTO -> Global data -> double clicked on include zxm06top.

Here I have declared gv_lifnr type lfa1-lifnr.

In include zxm06u36 of EXIT_SAPMMO6E_006 I have done the following.


gv_lifnr = i_ekko-lifnr.

loop at screen.
  if screen-name = 'ZSUP_EKCF-CFORMNO' and gv_lifnr is initial.
    screen-input = 0.
    modify screen.
  endif.
endloop.

now when i execute me21n I havn't selected any vendor the additional fields on the customer screen are enabled.

Regards,

Ranjith N

0 Kudos

Hi Nambiar,

In include zxm06u36 of EXIT_SAPMMO6E_006 do as follows:


gv_lifnr = i_ekko-lifnr.

In the screen 0101 define as follows:


PROCESS BEFORE OUTPUT.
MODULE set_status_0101.

Inside the module set_status_0101 use the following code:


loop at screen.
  if screen-name = 'ZSUP_EKCF-CFORMNO' and gv_lifnr is initial.
    screen-input = 0.
    modify screen.
  endif.
endloop.

According to your need, you may also put screen-active = 0/ screen-invisible = 1.

Hope this would clear the doubt.

Regards,

Abhisek.

Former Member
0 Kudos

Hi,

Under PROCESS BEFORE OUPUT i have defined module set_cform_status.

Now when i double click on this module it is getting created within a new include program

Eg INCLUDE ZXM06O01.

under this include i have written the following code.


module set_cform_status output.

loop at screen.
  if screen-name = 'ZSUP_EKCF-CFORMNO' and gv_lifnr is initial.
    screen-input = 0.
    modify screen.
  endif.
endloop.

endmodule.                 " set_cform_status  OUTPUT

when i check the include i get an error " Field gv_lifnr is unknown "

I am I right by writing the module within a new include ?

Or what is an issue here ?

Regards,

Ranjith N

0 Kudos

Hi,

You are right in your approach. Just check whether gv_lifnr is defined properly in top include ZXM06TOP of Include LXM06TOP.

Also check if the top include LXM06TOP is active or not. Then only activate include ZXM06O01.

Regards,

Abhisek.

Former Member
0 Kudos

le me cek.

Former Member
0 Kudos

do i need to pass 1 or 0 for disabling.

0 Kudos

For making the field Output Only.

Screen-input = 0.

To Inactivate the field.

Screen-active = 0.

To make the field invisible.

Screen-invisible = 1.

Were you able to activate the include?

Regards,

Abhisek.

Former Member
0 Kudos

ok. an why is it that when i execute me21n the customer additional screen is displayed first not the delivery/invoice tab rather.

Former Member
0 Kudos

still i see no difference abhishek.

the vendor no input field is empty on me21n.

the customer additional fields are still active, not hidden.

the vendor number field on me21n is taken from structure mepo_topline-superfield wil tis help us any how..

regards,

Ranjith N

0 Kudos

Check in debug mode if your piece is being trigerred correctly and also if the screen field name is correct.

Regards,

Abhisek.

Former Member
0 Kudos

Hi,

how do I get the vendor no from header to my customer subscreen.

what I have done is.

In EXIT_SAPMM06E_007 include zxm06u38.

I have coded.

set parameter id 'VAL' field gv_lifnr.

gv_lifnr is of type mepo_topline-superfield in include ZXM06TOP.

In screen 0101

under PBO in module set_cform_status.

get parameter id 'VAL' field gv_lifnr.

I have a vendor input field in my customer sub screen.

I am not getting the vendor value in the customer additional screen what I select on PO header.

Regards,

Ranjith N

0 Kudos

Since the variable gv_lifnr is defined globally.

So In include zxm06u36 of EXIT_SAPMMO6E_006 just do as follows:


gv_lifnr = i_ekko-lifnr.

You dont have to SET PARAMETER /GET PARAMETER.

The value will automatically be available in the screen PBO.

And to set value of gv_lifnr use EXIT_SAPMMO6E_006 and not EXIT_SAPMMO6E_007.

Regards,

Abhisek.

Former Member
0 Kudos

Hi,

On the customer screen I have vendor number input field with the name superfield.

so how would I assign the value of gv_lifnr to the screen field superfield.

Regards,

Ranjith N

0 Kudos

I suppose field superfield is in customer screen 0101.

To assign the value of gv_lifnr to field do as follows in PBO module:


superfield = gv_lifnr.

Regards,

Abhisek.

Former Member
0 Kudos

answered