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

Adding Condition types to ME11

Former Member
0 Likes
1,997

hello gurus!

My requirement is to add freight condition types to ME11 while creating info records. The users should enter freight conditions unconditionally w/o which the info record should not be saved. I tried validating this before save. I used Badi SD_COND_SAVE_A to validate if freight conditions are entered by the user, if not the transaction throws an error message. However the error message takes me back to the CREATE RECORD : PURCH. ORGANISATION DATA 1 screen and the net price entry gets locked and the PB00 condition type is also lost.

I am new to ABAP and in dire need of help!!!

Thanks in advance

1 ACCEPTED SOLUTION
Read only

eduardo_hinojosa
Active Contributor
0 Likes
1,692

Hi,

Create the BADI, activate it, and if you are creating it, check that in CT_KONPDB_NEW you have a line for the desired KSCHL and that CT_KONPDB_OLD is empty (without lines). I suggest you to set a break-point and check the structures in the interface. Set filters with commands CHECK to avoid that all kind of conditions run this coding.

For instance.



  CHECK sy-tcode = 'ME11'.

  field-symbols:  <konp_old> type konpdb,
                 <konp_new> type konpdb,
                 <konh_old> type konhdb,
                 <konh_new> type konhdb,
                 <kondat_new> type vkondat,
                 <kondat_old> type vkondat,
                 <vake> type vakevb.

      read table ct_konpdb_new assigning <konp_new>
                    with   kschl = 'COND'.
      IF sy-subrc <> 0.  
        MESSAGE e398(00) WITH ...
      ENDIF.

I hope this helps you

Regards

Eduardo

Hi,

Create the BADI, activate it, and if you are creating it, check that in CT_KONPDB_NEW you have a line for the desired KSCHL and that CT_KONPDB_OLD is empty (without lines). I suggest you to set a break-point and check the structures in the interface. Set filters with commands CHECK to avoid that all kind of conditions run this coding.

For instance.



  CHECK sy-tcode = 'ME11'.

  field-symbols:  <konp_old> type konpdb,
                 <konp_new> type konpdb,
                 <konh_old> type konhdb,
                 <konh_new> type konhdb,
                 <kondat_new> type vkondat,
                 <kondat_old> type vkondat,
                 <vake> type vakevb.

      read table ct_konpdb_new assigning <konp_new>
                    with   kschl = 'COND'.
      IF sy-subrc <> 0.  
        MESSAGE e398(00) WITH ...
      ENDIF.

I hope this helps you

Regards

Eduardo

7 REPLIES 7
Read only

eduardo_hinojosa
Active Contributor
0 Likes
1,693

Hi,

Create the BADI, activate it, and if you are creating it, check that in CT_KONPDB_NEW you have a line for the desired KSCHL and that CT_KONPDB_OLD is empty (without lines). I suggest you to set a break-point and check the structures in the interface. Set filters with commands CHECK to avoid that all kind of conditions run this coding.

For instance.



  CHECK sy-tcode = 'ME11'.

  field-symbols:  <konp_old> type konpdb,
                 <konp_new> type konpdb,
                 <konh_old> type konhdb,
                 <konh_new> type konhdb,
                 <kondat_new> type vkondat,
                 <kondat_old> type vkondat,
                 <vake> type vakevb.

      read table ct_konpdb_new assigning <konp_new>
                    with   kschl = 'COND'.
      IF sy-subrc <> 0.  
        MESSAGE e398(00) WITH ...
      ENDIF.

I hope this helps you

Regards

Eduardo

Read only

0 Likes
1,692

hi eduardo,

Thanks for answering. i tried what u suggested. but my problem is dat d main program for me11 is SAPMM06I. And the 'Create gross price conditon' (screen no 201) is from SAPMV13A. So when i try validating using SD_COND_SAVE_A the validation occurs but the error message is displayed on screen 102 of SAPMM06I. The basic price is initialized and the basic condition type is lost. So basically m back to square one.....

regards,

xineohpi

Read only

0 Likes
1,692

Hi xineohpi,

I run it with a break in fm SXV_GET_CLIF_BY_NAME to check what BADI's I can use (in a ECC50).

I can see CACS_COND_VERSIONING, but I have doubts that it works. After we have some BTE that SAP Note 325551 - Field check and field texts in condition tables refers, but I used it to do checks in the mantaining of conditions. Really, you don't forget anything to try it.

And the BADI that we are taking about.

Regards

Eduardo

Read only

0 Likes
1,692

hi eduardo,

I am unable to complete the requirement through me11. M thinking of checking for the freight conditions whilst the info record is used in me21n. So if the info record doesnot hav the freight conditions it'll display an error and the info record will have to be re-created properly. wht is ur take on dis?

Regards,

xineohpi.

Read only

0 Likes
1,692

Hi

In ME21N perhaps you can achiive it. Try with badi 'ME_PROCESS_PO_CUST, method CHECK. After, I think that you can achive control with IF_PURCHASE_ORDER_ITEM_MM~GET_CONDITIONS.

Regards.

Eduardo

Read only

0 Likes
1,692

hi eduardo,

No luck with ME_PROCESS_PO_CUST.... However, i found an exit(ZXM06U44) that satisfies my requirement.. but it displays the error message and re-initializes the entire PO which is again unacceptable.

Regards,

xineohpi.

Read only

0 Likes
1,692

hi eduardo,

GOOD NEWS!!! got it!!! There's an exit MM06E005 which has a FM EXIT_SAPMM06E_013 which allows you to check the condition records table TKOMV before saving. I then used macro MMPUR_MESSAGE to raise the error message. This triggers the Hold functionality which allows one to save the PO with errors to be updated later.

Thanks a ton for all your help.

take care.

Regards,

xineohpi