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: 

add custom field in me21n

Former Member
0 Kudos

added custom field in me22n in header level .. i want to make that field mandatory based on some condition like netpr > 'some amount'

here I'm using function exists EXIT_SAPMM06E_006. inside that include loop at screen is not working

pls guide me how to make that zfield mandatory on that condition

thanks & regards,

Anbu

1 ACCEPTED SOLUTION

atul_mohanty
Active Contributor
0 Kudos

Hi -

The sub screen that you have created, there will be PAI event. Is SE51, go to the PAI event. And craete a module example MODULE EVENT_PAI. Double click on it, it will propose you a include. Accept that, then in this module u can add your code.

MODULE event_pai INPUT

             

* Code for validation

ENDMODULE.

Let us know, if it helps.

Regards,

Atul Mohanty

10 REPLIES 10

nabheetscn
Active Contributor
0 Kudos

In subscreen PAI you can validate the same...

atul_mohanty
Active Contributor
0 Kudos

Hi -

The sub screen that you have created, there will be PAI event. Is SE51, go to the PAI event. And craete a module example MODULE EVENT_PAI. Double click on it, it will propose you a include. Accept that, then in this module u can add your code.

MODULE event_pai INPUT

             

* Code for validation

ENDMODULE.

Let us know, if it helps.

Regards,

Atul Mohanty

0 Kudos

hi atul,

       thanks for your info ..

        but i'm not getting any screen values in that subscreen .

  i needed to validate based on screen values only

see my below codeing

if sy-tcode = 'ME22N'.


if i_ekko-rlwrt > '10000000'.


loop at screen.
*   break sssmm.
if screen-name = 'CI_EKKODB-ZARIBA'.

        screen-required = '1'.
          modify screen.
  endif.
   endloop.
endif.

how to get screen values over pls

0 Kudos

Hi -

1. Declare a variable V_RLWART in the top include ZXM06TOP.

2. In the include ZXM06U36 of EXIT_SAPMM06E_006

Pass V_RLWART =   i_ekko-RLWART.

3. Now in your include you can check the condition V_RLWART > '10000000'.

I would suggest one more thing, you give screen field name in SE51 EKKO_CI instead of 'CI_EKKODB'

Let us know, if it helps.

Regards,

Atul Mohanty

0 Kudos

Make sure you are implementing it in the right exits.

EXIT_SAPMM06E_008 => ZXM06U37  - PAI.

From Screen to Database - PAI  eg -> e_ci_ekko-zzfield_001 = ekko-zzfield_001.

Make the validation in this exit. And set a flag.

EXIT_SAPMM06E_006 => ZXM06U36 - PBO

From Database to Screen eg -> ekko-zzfield_001 = i_ekko-zzfield_001.


Check the flag set in the PAI above, then loop at screen and set the screen-active, output and required attributes to 1 for that field.



0 Kudos

Hi atul,

    i got that one

another help..

i made that field mantatory based on condition ..so i'm entering some value to that field.

after changing to some other PO also same value remains for that field , i want to clear that field value and update to database before clearing

pls help me

0 Kudos

Hi -

Use exit ' EXIT_SAPMM06E_009' for the same.

Let us know, in case any further help.

Regards,

Atul Mohanty

0 Kudos

Hi Atul,

  i got the solution ...exit ' EXIT_SAPMM06E_006',exit ' EXIT_SAPMM06E_007' exit ' EXIT_SAPMM06E_008'

thanks you very much

regards,

Anbu

Former Member
0 Kudos

It would be better to use the badi ME_PROCESS_PO_CUST ...in that PROCESS_ITEM and PROCESS_HEADER methods..

You can post a check and validate input condition based in process methods

raymond_giuseppi
Active Contributor
0 Kudos

You should also use exit EXIT_SAPMM06E_012 in case user doesn't display the customer subscreen (so PAI wont be executed)

You could also migrate to more up-to-date BAdIs like ME_PROCESS_PO_CUST (for check) and ME_GUI_PO_CUST (for display of customer field) - Many threads/wiki blogs are available thru search tool at scn.

Regards,

Raymond