on 11-04-2009 10:29 AM
Hi all gurus,
I created a new FORM on an old SRM system (SRM 3) to allow the user to copy a PO.
It works as follows: when the user is in display mode on a Purchase Order, a custom button "Copy PO" is available. Once clicked, a message popup appear ("Order created.") and the new, copied PO should be visible on screen.
Please note that the new PO is NOT exactly a perfect copy because a pair of field, obligatory, have been blanked out (according the customer's requirement).
That's the scenario; I'm having difficulties in switching visualization from the old (source) PO to the new one.
That's the trick I used so far: after the PO process creation has been done, I simply call a BBP_PD_PO_GETDETAIL on the new Purchase Order filling the GS structure and GT tables which are defined in the TOP include and should be referred to what is shown on screen. In terms of code:
* UPDATE GLOBAL VARIABLES.
REFRESH: gt_item, gt_account, gt_partner, gt_text,
gt_org, gt_tax, gt_pridoc, gt_messages, gt_actval.
CLEAR: gs_header.
CALL FUNCTION 'BBP_PD_PO_GETDETAIL'
EXPORTING
i_guid = new_header-guid
* I_OBJECT_ID =
* I_ATTACH_WITH_DOC = ' '
i_with_itemdata = 'X'
* I_READ_BE_DATA = ' '
* I_ITEM_SORTED_BY_HIERARCHY =
* I_WITHOUT_HEADER_TOTALS =
IMPORTING
e_header = gs_header
* ET_ATTACH =
TABLES
e_item = gt_item
e_account = gt_account
e_partner = gt_partner
* E_CONFIRM =
e_longtext = gt_text
e_orgdata = gt_org
e_tax = gt_tax
e_pridoc = gt_pridoc
e_messages = gt_messages
e_actval = gt_actval
.
This solution SEEMS to work, because some data as for example the PO header description and the PO number are updated. We are then working effectively on the new, copied Purchase Order.
However, the fields that have been blanked out are not updated until we switch to the Change mode. So I guess that updating the GT tables is not sufficient and maybe there's another way/FM to call to switch to the new PO or simply keep this way of doing with an explicit screen update (how to?).
I'm waiting for your help/hints/suggestions, thanks in advance
Closed. Used a workaround in screen PBO.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Didn't understand why posting the code is so tricky... in preview mode the above post is ok, when posting all is messed up
Here's the snip of code anyway:
* UPDATE GLOBAL VARIABLES.
REFRESH: gt_item, gt_account, gt_partner, gt_text,
gt_org, gt_tax, gt_pridoc, gt_messages, gt_actval.
CLEAR: gs_header.
CALL FUNCTION 'BBP_PD_PO_GETDETAIL'
EXPORTING
i_guid = new_header-guid
* I_OBJECT_ID =
* I_ATTACH_WITH_DOC = ' '
i_with_itemdata = 'X'
* I_READ_BE_DATA = ' '
* I_ITEM_SORTED_BY_HIERARCHY =
* I_WITHOUT_HEADER_TOTALS =
IMPORTING
e_header = gs_header
* ET_ATTACH =
TABLES
e_item = gt_item
e_account = gt_account
e_partner = gt_partner
* E_CONFIRM =
e_longtext = gt_text
* E_LIMIT =
e_orgdata = gt_org
e_tax = gt_tax
e_pridoc = gt_pridoc
e_messages = gt_messages
e_actval = gt_actval
* E_ACC_ACTVAL = gt_acc_actval
* E_VERSION =
* E_HEADER_REL =
* E_ITMLIM_REL =
* E_STATUS =
.
Edited by: Matteo Montalto on Nov 4, 2009 11:37 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.