UBE to Cancel Component Lines if the Parent Line is Cancelled

praveenk

Member
Hi all,

I am new to JDE.I stuck up with one UBE,

Purpose of UBE:

• To review cancelled parent items (kit items) in the Sales Order Detail (F4211) file and make sure that all of the component lines have been cancelled. If lines are found that are still at an open status, these lines should be cancelled. This cancellation process will include writing a record to the Sales Ledger file (F42199). The only lines to be updated will be those that need to be cancelled. In other words, no updates will be processed to the F4211 or F42199 files unless a line needs to be cancelled. This UBE should generate a report showing those items that will be changed. (This should be the Parent item and any child item)

In report initialize section i have given conditions as

• Select from the F4211 file where SDCOMM = ‘K’ (these are the parent items)
• Where SDCNDJ is in the given date range that is specified by a processing option. If no date range is given, default to today
• And SDLTTR = ‘980’ or ‘984’
• And SDNXTR = ‘999’


and in DO section i used

F4211.Select
F4211.Fetch Next to read component lines


Logic

• The program should look at all cancelled kit parent lines that have been selected in the data selection.
• Use the kit related fields to determine which lines are related to each other. If the component line’s next status is not equal to ‘999’, then cancel the component line.
o In the F4211, the kit related fields are as follows:
 SDRLIT = The Short Item Number (SDITM) of the parent line.
 SDKTLN = The Line Number of the Parent item.

But i am not getting correct output.

Output

• The report should show the parent item and the associated related lines being cancelled.


Can any one help me out in this issue.

Thanks,
Praveen.
 
Praveen,

The Data Selection is OK. But you can do in this way -

1) Select all the records with the following selection
a) SDNXTR ='999'
SDLTTR = '984' or '980'
SDLNTY = 'K' (Which stands for KIT Items usually)
2) Now you have all the records which are of line type K means parent items and cancelled line too.

3) Now Do a Select and fetch next based on the Order number(SDDOCO),Order type(SDDCTO),SDLNID(Line Number),Order Key Company(SDKCOO) and for each line fetch the NEXT and LAst status and other wise you can aslo check the cancelled date is Blank or Populated.
If any of the condition fails just for that line update the Status to 999 and 980 and populate the Cancel date.

Please use the Business function for Updating the F4211 and inserting a new line into F42199(Ledger).
Its usually not recommended to use Manual Upadtes.

When ever you update then pass the same Order number,Line number ,company ,order type to RV variables and call the print section....

Hope this might help you...

Thanks
Mark Peter
A7.3,WorldSoft,Cum12.
Enterprise One World(XE),SP12
 
Back
Top