2008 Feb 28 9:36 AM
Hi Friends,
I am doing bdc call transaction method.Releasing delivery block from sales order at header level n item level.
I am getting all sales order which r having block order.The output is constructed like when i select 1 sales order n click on release that sales order should release...
Each sales order is having 1 to 3 item so the output is displaying 3 times each sales order with different item. means 3 coloums ...
But what the problem is each sales order is having more then 1 item so when i am selecting each sales order it is releasing the whole document....
suppose 3000000234 is having item 10,20,30 i want to release onlt sales order 3000000234 with item 10.but is realising whole document..
now how to solve the problem plzzz any one help me..
2008 Feb 28 2:04 PM
Hi
Use the BAPI. Instead of BDC.
data:
it_atg_delcreate LIKE vbap OCCURS 1 WITH HEADER LINE,
order_item TYPE TABLE OF bapisditm WITH HEADER LINE,
order_itemx TYPE TABLE OF bapisditmx WITH HEADER LINE,
returnmsg
LIKE bapiret2 OCCURS 1 WITH HEADER LINE,
schdulelines
LIKE bapischdl OCCURS 1 WITH HEADER LINE,
schedulelinex LIKE bapischdlx OCCURS 1 WITH HEADER LINE,
atg_orderheader LIKE bapisdh1x,
atg_orderheader-updateflag = 'U'.
LOOP AT it_atg_delcreate.
order_item-itm_number = it_atg_delcreate-posnr.
APPEND order_item.
CLEAR:order_item.
order_itemx-itm_number = it_atg_delcreate-posnr.
order_itemx-updateflag = 'U'.
APPEND order_itemx.
CLEAR:order_itemx.
schdulelines-req_dlv_bl = space.
schdulelines-itm_number = it_atg_delcreate-posnr.
schdulelines-sched_line = '0001'.
APPEND schdulelines.
schedulelinex-req_dlv_bl = 'X'.
schedulelinex-itm_number = it_atg_delcreate-posnr.
schedulelinex-updateflag = 'U'.
schedulelinex-sched_line = '0001'.
APPEND schedulelinex.
CLEAR: schedulelinex, schdulelines.
AT END OF vbeln.
CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
EXPORTING
salesdocument = it_atg_delcreate-vbeln
order_header_inx = atg_orderheader
TABLES
return = returnmsg
order_item_in = order_item
order_item_inx = order_itemx
schedule_lines = schdulelines
schedule_linesx = schedulelinex.
IF sy-subrc = 0.
Clearing the values
REFRESH : order_item,
order_itemx,
schdulelines,
schedulelinex.
CLEAR : order_item,
order_itemx,
schdulelines,
schedulelinex.
ENDIF.
ENDAT.
ENDLOOP.
Commit the database
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X'.
The above is exactly suits u r requirement.
If it is helpful rewards ponits.
Regards
Pratap.M
Hi Friends,
I am doing bdc call transaction method.Releasing delivery block from sales order at header level n item level.
I am getting all sales order which r having block order.The output is constructed like when i select 1 sales order n click on release that sales order should release...
Each sales order is having 1 to 3 item so the output is displaying 3 times each sales order with different item. means 3 coloums ...
But what the problem is each sales order is having more then 1 item so when i am selecting each sales order it is releasing the whole document....
suppose 3000000234 is having item 10,20,30 i want to release onlt sales order 3000000234 with item 10.but is realising whole document..
now how to solve the problem plzzz any one help me..
2008 Feb 28 2:04 PM
Hi
Use the BAPI. Instead of BDC.
data:
it_atg_delcreate LIKE vbap OCCURS 1 WITH HEADER LINE,
order_item TYPE TABLE OF bapisditm WITH HEADER LINE,
order_itemx TYPE TABLE OF bapisditmx WITH HEADER LINE,
returnmsg
LIKE bapiret2 OCCURS 1 WITH HEADER LINE,
schdulelines
LIKE bapischdl OCCURS 1 WITH HEADER LINE,
schedulelinex LIKE bapischdlx OCCURS 1 WITH HEADER LINE,
atg_orderheader LIKE bapisdh1x,
atg_orderheader-updateflag = 'U'.
LOOP AT it_atg_delcreate.
order_item-itm_number = it_atg_delcreate-posnr.
APPEND order_item.
CLEAR:order_item.
order_itemx-itm_number = it_atg_delcreate-posnr.
order_itemx-updateflag = 'U'.
APPEND order_itemx.
CLEAR:order_itemx.
schdulelines-req_dlv_bl = space.
schdulelines-itm_number = it_atg_delcreate-posnr.
schdulelines-sched_line = '0001'.
APPEND schdulelines.
schedulelinex-req_dlv_bl = 'X'.
schedulelinex-itm_number = it_atg_delcreate-posnr.
schedulelinex-updateflag = 'U'.
schedulelinex-sched_line = '0001'.
APPEND schedulelinex.
CLEAR: schedulelinex, schdulelines.
AT END OF vbeln.
CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
EXPORTING
salesdocument = it_atg_delcreate-vbeln
order_header_inx = atg_orderheader
TABLES
return = returnmsg
order_item_in = order_item
order_item_inx = order_itemx
schedule_lines = schdulelines
schedule_linesx = schedulelinex.
IF sy-subrc = 0.
Clearing the values
REFRESH : order_item,
order_itemx,
schdulelines,
schedulelinex.
CLEAR : order_item,
order_itemx,
schdulelines,
schedulelinex.
ENDIF.
ENDAT.
ENDLOOP.
Commit the database
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X'.
The above is exactly suits u r requirement.
If it is helpful rewards ponits.
Regards
Pratap.M
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |