I have an interesting but quite painful case when adjusting a recorded LSMW.
Case: I need to carry out a task in a custom tcode. The tcode itself is simple: it is just the table display of a custom table with three columns: vendor ID, vendor name (autofilled when vendor ID is entered) and a tickbox.
1. I go to this tcode
2. search for a vendor
3.1. if found, I add the tick, save and quit.
3.2. If not found, I press New Vendor tab, and enter the vendor ID, add the tick, save and quit.
The challenge: I don't know how to apply conditional scenarios.
If the vendor is already available in the list and I just add the tick and save, it would drop an error message in case of new vendor that is still not in the list.
Vice versa, the second part (adding new vendor to list) would drop an error message if I did it with an already existing vendor that was already updated in the first step.
Also the recorded fields won't be found on the screen in case of error so the process would be blocked.
How can I prevent error screens, and modify the recording to:
1. proceed with first scenario (updating existing vendor), then save and quit?
2. proceed with second scenario (entering vendor) in case of new vendor, ignoring the first scenario?
If you need any specific detail I am keen to elaborate further. I really trust your experience guys.
Thank you in advance, Laszlo