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: 

Contract program

Former Member
0 Kudos

Hi,

While creating contracts, if I have same Customer, material, and valid dates ranges i need to stop the transaction. For this I need to generate report program. The data comes fron flat file.

Please give suggestion how to approach.

Thanks,

Rani.

5 REPLIES 5

Former Member
0 Kudos

HI,

Contracts can be created either by using BAPI or BDC method.

In your program sort the internal table, which has contract details, by customer, material and date.

Follow the mentioned procedure.

LOOP AT IT_CONTRACT into LS_CONTRACT.

AT NEW DATE-RANGE.

create contract.

ENDAT.

ENDLOOP.

Use BAPI_CONTRACT_CREATEFROMDATA for COntract creation using BAPI method.

Regards,

Vara

Former Member
0 Kudos

Hi RANI,

Copy the main internal table to Main2 internal table.

Describe table Main into v_main variable.

Sort the internal table Main2 by customer and material and date.

Use Delete Adjacent duplicates from Main2.

Use Describe table Main2 into variable V_MAIN2

If v_main NE v_main2

stop the program

endif.

Regards

Arun

0 Kudos

Hi,

I need that user exit name and while creating Contract manually if there is any duplicate based on customer, material and valid dates I need to display error message.

Please update me as soon as possible.

Thanks,

Rani.

0 Kudos

Hi Rani

If you are looking for validation via user-exit i guess you can do the same via: USEREXIT_SAVE_DOCUMENT_PREPARE of include: MV45AFZZ.

Though i beleive, it is easy to do the validation in the report program that you upload the flat file and load the contracts.

Kind Regards

Eswar

0 Kudos

Hi Eswar,

It is not the matter of uploading contracts through flat file. I need to check the duplicate records while creating or changing through VA41 or VA42. while saving the document if we have any duplicate records based on Customer, material and dates we have display error message & stop the transaction.

Thanks for your information about user exit name and form name.

Thanks,

Rani.