2013 Jan 10 11:24 AM
Sir,
In my TMG there are fields district and warehouse. data was populated in to that TMG from upload program
the last four digits of the warehouse must be equal to the district code.
The data will be populated in wrong format for the warehouse field . the user will refer the district field and changes the last four digits
of the warehouse field.
so if he changes according to the district code which was available the data should save.
other wise it should throw a validation.
where can i write the validation in the TMG.
Thanks & Regards.
2013 Jan 10 11:33 AM
Hi,
Some ways is there,
like the event.
this link will help u to understand
http://wiki.sdn.sap.com/wiki/display/ABAPch/EVENTS+IN+TABLE+MAINTENANCE
other is from table main, screen>system>status>program>in PAI >create a module.
U can write.ur logic/validation.
Hope it helps.
Thanks
Gourav.
Hi,
Some ways is there,
like the event.
this link will help u to understand
http://wiki.sdn.sap.com/wiki/display/ABAPch/EVENTS+IN+TABLE+MAINTENANCE
other is from table main, screen>system>status>program>in PAI >create a module.
U can write.ur logic/validation.
Hope it helps.
Thanks
Gourav.
2013 Jan 10 11:27 AM
2013 Jan 10 11:33 AM
Hi,
Some ways is there,
like the event.
this link will help u to understand
http://wiki.sdn.sap.com/wiki/display/ABAPch/EVENTS+IN+TABLE+MAINTENANCE
other is from table main, screen>system>status>program>in PAI >create a module.
U can write.ur logic/validation.
Hope it helps.
Thanks
Gourav.
2013 Jan 10 11:40 AM
2013 Jan 11 4:53 PM
Hi Satish,
You can use TMG events for your requirement.
You can also create a module in PAI for validating the data.
eg: FIELD <warehouse field> MODULE<your module>.
Here you can put your desired condition and display an error message if the condition fails.
I have tried this and it works perfectly
2013 Jan 15 5:09 AM
Sir,
Can pls post the code of what u have written.
Thanks & Regards.
2013 Jan 15 5:51 AM
<Link removed by moderator>
Check above link..
Regard's
Smruti
Message was edited by: Vinod Kumar
2013 Jan 15 6:24 AM
hi,
create TMG, goto ENVIRNAMENT -> modifications -> events.
later u will be getting many events select BEFORE save events.
write code within method generate for the events and do validations there only.
like say you have field XXX of table abc should be 123 else you have through error then write like
if abc-xxx = '123'.
else.
"error'.
exit.
endif.
regards.
lingaraj.
2013 Jan 15 6:29 AM
Hi Satish,
Please follow the below steps:
1. Go to the FunctionPool of your TMG.(It must have name like ZSAPLTABLE where your table name is ZTABLE).
2. Create a new include with name ZLTABLEF01(This is required as the system gives a message saying 'User xxxxxx is currently editing the program ZSAPLTABLE'). Save and avtivate the program.
3. Now go to the screen flow logic of the TMG screen.
4. You have to write the code in bold as shown below
LOOP AT EXTRACT.
MODULE LISTE_INIT_WORKAREA.
CHAIN.
FIELD dist_code.
FIELD warehouse MODULE check_distcode(or whatever name you want to give).
5. Now double click on check_distcode and the system will ask if you want to create a new module. Click yes and select the name of the new include you have created in step 2 above.
6. Write the below code in the module
IF ZTABLE-warehouse+length(4) NE ZTABLE-distcode. (where length is the no. of digits before last 4 digits)
.... Throw up an error message
ENDIF.
7. Save and activate the module and the main TMG program. Check the validation in SM30.
Hope this helps
Reward points if helpful
2013 Jan 18 10:19 AM
2013 Jan 18 10:22 AM
2013 Jan 18 10:25 AM
2013 Jan 15 7:08 AM
Hi Satish,
Check this link.
http://help.sap.com/saphelp_47x200/helpdata/en/91/ca9f0ea9d111d1a5690000e82deaaa/frameset.htm
"Before Saving the Data in the Database"
Regard's
Smruti
2013 Jan 18 10:21 AM
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |