Update Shipment Number(SHPN) from P4210 Application

w2vijay

w2vijay

Well Known Member
Hi All,

I have a requirement to include shipment number(SHPN) field in the grid of sales order revisions form(W4210A) of Sales Order Entry application P4210. Then the user will manually enter or change the shipment numer value in the grid. When the OK button is clicked the shipment number entered in the grid should be updated to sales order line table F4211.

VA frm_mnSHPNLineCounter_MATH10 = "1"
Get Max Grid Rows(FC Grid, VA frm_mnSHPNMaxGridRows_MATH10)
While VA frm_mnSHPNLineCounter_MATH10 is less than VA frm_mnSHPNMaxGridRows_MATH10
Get Grid Row(FC Grid, VA frm_mnSHPNLineCounter_MATH10)
F4211.Update
VA frm_mnSHPNLineCounter_MATH10 = [VA frm_mnSHPNLineCounter_MATH10]+1
End While


I have written the above code in the Ok button post button clicked event. But no luck. After reviewing the whole application code and debugging the each event what I observed is all the sales order lines added or updated will be handled by master business functions present and caches to hold the current sales lines and to complete the transactions at the end.

When the debugger is on system funtions 'get max grid rows' and 'Get grid row' are working fine displaying the max rows and grid values. But the problem is at the update statement. It is taking more than 3 mins to complete the statement and not updating the table.

Any ideas how to accomplish this requirement or which event will be appropriate to include the custome code.

*** Zoltan sir any ideas.
 
I think you're in the right event. A few things:
1) At what point in that event are you trying your update? (it should be after the call to EndDoc)
2) If your EndDoc call is running Async, you will almost certainly run into issues as your update statement will most likely occur before the inserts/updates to F4211 that happen in EndDoc
3) Your log should have some indication as to what is happening when you are performing the update...look in there. If the physical records exist in the DB at time of update, it's a simple update statement that should work just fine. You are using the entire primary key, right?

My preference: write a bsfn to update the F42UI11 cache with the SHPN value(s) from the grid. Call this just prior to EndDoc. No worries about waiting for EndDoc to finish first...it will take care of the updates for you.

What release are you on? I ask because, if you are on 8.10 or later (I think it's 8.10), the handling of the sales order caches was modularized and it makes it a lot easier to write c-code to manipulate. One caveat is that your bsfn dll must be CSALES in order for your custom code to call the cache handling functions used.
 
Hi Jeremy,

Sorry for late reply, issue with F4211.SHPN update is resolved.


Below are the options to update the shipment number.

1.PushButton on form - call it from postbutton clicked or end dialog.
2.Try to use F4211FSEditLine Process - This BSFN writes data to work file F42UI12.
3.Modify EditLine BSFN, by adding SHPN data item to BSFN data structure and c source code.
4.Create work table,use TC batch to update. Call the report from postbutton clicked.

I tried with second option. Only one BSFN, easy for maintenance and retrofitting when ESU's are applied.

At two places the BSFN is present.

1.Write Grid Line - Before - This event is fired only once in update mode. Ignore this event.

If GC NextStatus is not equal to "999" Or SV Form_ Mode is not equal to CO UPDATE_MODE
If VA frm_HeaderValuesChanged is equal to "1" Or FI cIsOPChangedInHeader is equal to "1"
If SV Form_ Mode is equal to CO UPDATE_MODE
F49211 Maintain Sales Detail Table
End If
F4211 Pre Process Values For Edit Line
End If
End If

2.Row Exit Changed - Asynchronous - This event will be fired both in add mode and edit mode. Below code is already disabled.

If GC UserCode is greater than <Blank> Or GC UserDate is greater than <Null Date> Or GC UserAmount is greater than <Zero> Or GC UserNumber is greater than <Zero> Or GC UserReference is greater than <Blank>
If VA grd_mnF42UI11WFLineNumber_LNIX is equal to <Zero>
VA frm_LNIX_Prev_WF_Line_Num = [VA frm_LNIX_Prev_WF_Line_Num]+1
VA grd_mnF42UI11WFLineNumber_LNIX = VA frm_LNIX_Prev_WF_Line_Num
End If
F4211 Pre Process Values For Edit Line
GC Source ofData = "7"
End If

After the above code I just added one condition on GC shipment number and passing GC Shipment number to the BSFN. The application is working fine updating the F4211 record with shipment number both in add and edit mode.

If GC ShipmentNumber is greater than <Blank>
F4211 Pre Process Values For Edit Line
End If

Hope this helps someone with similar requirement.
 
Vijay

Is this the only way to update the shipment number on the sales order line?

I have a custom application through which I would like to update the shipment number. I understand that there are related tables in 42 and 49 systems which may need update.
 
F4217 is the shipment ref numbers, but yes there are several

Best bet is to look at the screen that adds a shipment to the SO and call the same BSFNs the way the screen does it

BSFN N4900570 Update F4211 F46199 with shipment is a good starting point :)

BSFN N490050 F4215 Update Shipment Totals is just one of many others called
F4943 Shipment Pieces is another
F4941 is yet another
 
Vijay,

At several clients, we've modified the MBF as well.

There's an occasional gotcha, though. I don't recall the version. If 'something' passes a blank into the data structure, the SHPN would go away. The function wasn't able to identify if a blank was to replace the original value or 'just' wasn't passed in.

The Minutes Wait issue - most-likely related to Indexing? Capture good logs and run it through Patwel's JDETrace tool

(db)
 
Back
Top