‎2006 Dec 07 3:04 PM
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.
‎2006 Dec 07 4:24 PM
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
‎2006 Dec 08 10:17 AM
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
‎2006 Dec 14 4:50 PM
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.
‎2006 Dec 15 2:15 AM
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
‎2006 Dec 15 4:49 AM
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.