E9.2 Use file contents as data selection

tkehoe

Member
Hi I have a list of Work Order numbers in a custom table. I want to call the R48425 WO print program using the file contents as data selection and create a single pdf. Is there a way to do that?

Thanks
 
Write a simple UBE that reads from your custom table and then sets a flag (maybe in a user-reserved field) on the WO Header (F4801) table. Then run R48425 and use that flag in the data selection. Then run another version of the simple UBE to blank out/zero out the flag on the WO Header table. If you write the UBE correctly, you could use processing options to control if it sets or clears the flag, and then just have two versions (one to set the flag and the other to clear the flag).
 
I copied R48425 and created a joined bsvw to the worktable to use as data selection but I like this idea better. I can update the F4801 in the process used to populate the worktable so a new UBE may not be necessary.

Thanks so much.
 
Keep in mind that you may have multiple users in the system working with Work Orders. Even if you don't think you will, your solution should always assume and handle multiple users in the system or the possibility that multiple instances of your process may execute at the same time. There are probably multiple ways to accomplish this. One possible way (and there would be multiple variations off this general idea):

1. Create a table with a GUID column, and then the fields for the work order numbers. PK is GUID + work order fields with GUID as first column (to benefit from partial key search in WHERE clause).
2. Write out the list of orders from the file to this table with all the list of work orders all having the same GUID value.
3. Create a driver UBE that data selects on the GUID value and then for each work order in the list calls R48425 for each work order in the list (may have to mod R48425 to data select on RI values).
4. At process end delete the list of work orders for the given GUID from the "work table".

In this way if this process gets launched multiple times for separate list of orders, each list of work orders will have a separate GUID value and the multiple instances of the driver UBE will be operating on each separate list based on the unique GUID value.

Another variation on the above if you want to avoid a "work table" would be to read the list from the file into memory (jdeCache, linked list, dynamic array, etc.) and then call R48425 as you iterate this list in memory or simply call R48425 as you parse the file. Probably could use this same technique using Orchestrator as a driver. Multiple variations on the same idea with the general idea of having some driver process call R48425 for each work order in the list.

If you want to run one instance of R48425 for the entire list instead of some type of driver calling an instance for each work order you could probably do this using the same technique above but it would most likely be a pretty invasive mod to R48425.
 
This chrome extension can help you to easily import list of values in data selection instead of having to enter them manually one at a time.
 
Thanks for the replies, here's what I ended up doing:

Added a hidden Grid Record Selected column and a "Print WO's" pushbutton to the P48320 application
Added validation code to ensure records are displayed in the grid and at least one record is selected
Write the selected WO numbers to a worktable and update F4801/URCD for the same DOCO to "1"
Created a separate version of R48425 with data selection, where F4801/URCD = 1
Call the new version of R48425 and clear the worktable

When the new pushbutton is first clicked, do a fetch to the worktable and if any records exist, display an error message saying the System is busy, try in a few minutes
Else Clear F4801/URCD flags and continue processing
 
Back
Top