Req Help to Update LIKP-LIFSK,Delivery Header block through custom program.
Hi everyone,
Can you please suggest a FM or BAPI to update the delivery header block field, LIFSK, in LIKP table through FM or a BAPI.
I tried using 'BAPI_OUTB_DELIVERY_CHANGE' as below to update the LIKP-LIFSK, but it is not working.
DATA : ls_likp TYPE likpvb,
ls_dlv_header TYPE bapiobdlvhdrchg,
lt_dlv_items_control TYPE STANDARD TABLE OF bapiobdlvitemctrlchg,
ls_dlv_item_control TYPE bapiobdlvitemctrlchg.
DATA : ls_dlv_hdr_control TYPE bapiobdlvhdrctrlchg,
ls_dlv_techn_control TYPE bapidlvcontrol,
lt_bapireturn TYPE STANDARD TABLE OF bapiret2,
ls_bapireturn TYPE bapiret2,
lt_bapiext2 TYPE STANDARD TABLE OF bapiext,
ls_bapiext2 TYPE bapiext.
DATA : BEGIN OF ls_mns_of_del,
vbeln TYPE likp-vbeln, "delivery number
lifsk TYPE likp-lifsk, "means of transport
END OF ls_mns_of_del.
CONSTANTS : lc_del_blck TYPE bapiext-param VALUE 'LIKP-LIFSK'.
PARAMETERS : p_dlv TYPE likp-vbeln OBLIGATORY." OBLIGATORY.
SELECT SINGLE *
FROM likp
INTO ls_likp
WHERE vbeln = p_dlv.
CHECK sy-subrc = 0.
CLEAR : ls_bapiext2.
ls_mns_of_del-vbeln = ls_likp-vbeln.
ls_mns_of_del-lifsk = 'BX'.
ls_bapiext2-param = lc_del_blck .
ls_bapiext2-value = ls_mns_of_del.
APPEND ls_bapiext2 TO lt_bapiext2.
CALL FUNCTION 'MAP2E_LIKPVB_TO_BAPIOBDLVHDRCH'
EXPORTING
likpvb = ls_likp
CHANGING
bapiobdlvhdrchg = ls_dlv_header.
CALL FUNCTION 'BAPI_OUTB_DELIVERY_CHANGE'
EXPORTING
header_data = ls_dlv_header
header_control = ls_dlv_hdr_control
delivery = ls_likp-vbeln
techn_control = ls_dlv_techn_control
TABLES
extension2 = lt_bapiext2[]
return = lt_bapireturn[]
EXCEPTIONS
communication_failure = 1
system_failure = 2
OTHERS = 3.
IF lt_bapireturn[] IS INITIAL.
COMMIT WORK AND WAIT.
MESSAGE 'Success' TYPE 'I' DISPLAY LIKE 'S'.
LEAVE LIST-PROCESSING.
ELSE.
MESSAGE 'Error' TYPE 'I' DISPLAY LIKE 'E'.
LEAVE LIST-PROCESSING.
ENDIF.
Hi ,
After seeing your code, you are not passing any parameters to header control data. once check the below code, it might useful.
DATA: h_data like bapiobdlvhdrchg,
h_control like bapiobdlvhdrctrlchg,
delivery like bapiobdlvhdrchg-deliv_numb,
item_data like bapiobdlvitemchg occurs 0 with header line,
item_control like bapiobdlvitemctrlchg occurs 0 with header line,
return like bapiret2 occurs 0 with header line.
CLEAR: h_data, h_control, delivery, item_data, item_control,
return.
REFRESH: item_data, item_control, return.
h_data-deliv_numb = gst_alv_table-c6_vbeln.
h_data-dlv_block = p_new_del_blck. "the new delivery block
h_control-deliv_numb = gst_alv_table-c6_vbeln.
h_control-dlv_block_flg = 'X'.
delivery = gst_alv_table-c6_vbeln.
CALL FUNCTION 'BAPI_OUTB_DELIVERY_CHANGE'
EXPORTING
header_data = h_data
header_control = h_control
delivery = delivery
TABLES
return = return .
"Check if return table got an error.
READ TABLE return WITH KEY type = 'E'.
IF NOT sy-subrc IS INITIAL.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X'.
ELSE.
ROLLBACK WORK.
ENDIF.
Regards,
Parupelly
Similar Messages
-
Urgent help needed-Updating an outbound delivery.
Hi,
I have created an outbound delivery for a stock transport order in using VL10D.
The otbound delivery then goes to a different system wherein it is updated with picking,packing and shipping info.Then it comes back to SAP in the form of idoc(DELVRY05).Now what I need is to write a code in an exit(I know where to write the code) from where the data in the idoc will update the outbouned delivery with picked and delivered quantity.
I tried using FM's SD_DELIVERY_UPDATE_PICKING and WS_DELIVERY_UPDATE_2 but it is not working.Also where will I get to see the update if it happens.
Please help me.Its required urgently.
Thanks,
Sandeep.Sandeep,
I m trying to understand this requirement. Your IDOC comes in with updated information for a delivery thats already available in the system.
In this case, the IDOC would lock the delivery object for its ude, so writing FM's directly might not help.
Please let me know your process code or your inbound FM. If it is IDOC_INPUT_DELVRY, then it already uses a WS_DELIVERY_UPDATE_2 , so there is little reason why you should be calling the FM again.
Please note that when this comes in it creates an inbound delivery rather an outbound. So, is your third party system sending you back an outbound IDOC?
Do you want to update the delivery that u sent out ( SD) to the third party system from that information.
In that case, please use BAPI_OUTB_DELIVERY_CONFIRM_DEC. This is for delivery conformation from a third party system. The documentation is very clear and there are toms of examples on SDN.
Please reward if useful.
Thanks
Ganesh.S -
Help required. How to print Header Text in customized PO ?
Hi experts,
Please help me go forward with this.
I'm using a ZMEDRUCK & standard printing program.
I have put my code here. Pls go through it and help me what has to be corrected here.
PROGRAM ZMEDRUCK_SUBP2.
FORM fetch_table_data TABLES in_tab STRUCTURE itcsy
out_tab STRUCTURE itcsy.
TABLES EKKO.
DATA: BEGIN OF header OCCURS 0,
ld_txt1(163),
ld_txt2(163),
ld_txt3(163),
END OF header.
DATA: li_lines LIKE STANDARD TABLE OF tline WITH HEADER LINE,
ID like THEAD-TDID,
TNAME LIKE THEAD-TDNAME,
TDOBJECT like THEAD-TDOBJECT.
DATA HTEXT LIKE EKKO-EBELN.
DATA f_lines TYPE P.
* HTEXT = EKKO-EBELN.
READ TABLE in_tab WITH KEY EKKO-EBELN.
if sy-subrc = 0.
TNAME = in_tab-value.
ENDIF.
*TNAME = EKKO-EBELN.
*CONCATENATE EKPO-ebeln EKPO-ebelp INTO v_item_text.
*MOVE v_head_text to HNAME.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = TNAME
IMPORTING
OUTPUT = TNAME
CALL FUNCTION 'READ_TEXT'
EXPORTING
* CLIENT = SY-MANDT
id = 'F01'
language = 'E'
name = TNAME
object = 'EKKO'
* ARCHIVE_HANDLE = 0
* LOCAL_CAT = ' '
* IMPORTING
* HEADER = TNAME
tables
lines = li_lines
EXCEPTIONS
ID = 1
LANGUAGE = 2
NAME = 3
NOT_FOUND = 4
OBJECT = 5
REFERENCE_CHECK = 6
* WRONG_ACCESS_TO_ARCHIVE = 7
* OTHERS = 8
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
READ TABLE li_lines INDEX 1.
IF sy-subrc = 0.
header-ld_txt1 = li_lines-tdline.
ENDIF.
DESCRIBE TABLE li_lines LINES f_lines.
data: lstr type String,
lstr1 type string,
lstr2 type string,
lstr3 type string,
lstr4 type string.
read table li_lines index 1.
lstr = li_lines.
condense lstr.
clear li_lines.
read table li_lines index 2.
lstr1 = li_lines.
condense lstr.
clear li_lines.
read table li_lines index 3.
lstr2 = li_lines.
condense lstr.
clear li_lines.
if f_lines GT 3.
read table li_lines index 4.
lstr3 = li_lines.
condense lstr.
clear li_lines.
read table li_lines index 5.
lstr4 = li_lines.
condense lstr.
clear li_lines.
endif.
DATA: v_text type text.
CONCATENATE lstr1 lstr2 lstr3 lstr4 into v_text separated by ' '.
CLEAR out_tab.
READ TABLE out_tab WITH KEY name = 'TNAME'.
out_tab-value = v_text.
MODIFY out_tab INDEX sy-tabix.
ENDFORM.
And my script is :
/:PERFORM FETCH_TABLE_DATA IN PROGRAM ZMEDRUCK_SUBP2
/:USING &EKKO-EBELN&
/:CHANGING &TNAME&
/: ENDPERFORM
IL RECEIVED FROM M/S &TNAME&Hi,
Use this Function module 'READ_TEXT'
T_lines contains the header text, you can loop it and display it in sap script
Function module to read the header text
CALL FUNCTION 'READ_TEXT'
EXPORTING
client = sy-mandt
id = 'F01'
language = sy-langu
name = ekko-ebeln
object = ekko
TABLES
lines = t_lines
EXCEPTIONS
id = 1
language = 2
name = 3
not_found = 4
object = 5
reference_check = 6
wrong_access_to_archive = 7
OTHERS = 8.
Regards
Krishna -
Sales District updation in Delivery header table
Dear Gurus,
Sales district is mandatory field in customer master and is copied to the sales orders, when the delivery document is created the sales district is not copied.
Is there any technical way or customization process to update the sales district in LIKP.
In this project we ARE NOT USING shipment and transportation process.
the process implemented here is Sales Order creation, followed by delivery creation (picking and Post goods issue) and finally Invoice creation and posting to accounts.
Kindly help me in achieving the updation of Sales district in LIKP table.
Thanks and Regards
LRHello,
The current copy control setting between the sales order and delivery is as per the standards.
ie 001 - Header
Please suggest a better approach whether:
Data Transfer routine - 001 -Header (FV50C001) which is a default routine to be copied and add the logic of updating the sales district in delivery header and maintain in place of 001
or
copy the Data transfer routine - 002 - Business Data ( FV50C002) to a new routine activate the logic of copying the sales district from VBKD to LIKP and maintain in place of 001
The replies suggested by seniors is very helpful.
Kindly help me to come out of my confusion.
Thanks and Regards
LR -
Reg:Updating Delivery header conditions
Hi ,
We need to update delivery header condition with a condition type(Say: ZXXX).
is it possible to update the same using some BAPI.
Please note that it is delivery header condition not item condition.
thanksHi,
PO header condition shows the price of all the items seperately when material are seperate. when u have the same material of five line items it will club together and shows it as one. -
In delivery - Header- Administration-Sales office is blank.
Hi Gurus
Please help as I am not getting entries updated in LIKP-VKBUR (Sales office in case of deliveries).
So In every Delivery--Header-Administration--Sales Office is blank.
I have checked the following:
1. Sales office entries are maintained in Customer Master.
2. At creation of sales order, VBAK-VKBUR it is available.
3. At delivery table LIKP-VKBUR it is not available.
4. At invoice VBPR-VKBUR it is available.
Could you please advice as why the sales office is not flowing to delivery header from the sales order header.Hi Raghu Chawla
These data transfer from order to delivery is controled by the copy control. Check your settings in VTLA for your sales order and delivery type. Select it and go to details screen. Check the routines. If there is no standard SAP routine available to copy the sales office then you can create a new routine by copiying the existing one in VOFM transaction after getting access key from SAP and assign that to copy control header routine. Your problem will be solved. -
Copy data from VBAK to LIKP during delivery creation
Hi Experts,
There is a custom field ZZLATESTDATE in the table VBAK. This is entered during sale order creation on the screen in the Additional Data tab of VA01 transaction.
Now when I create a delivery with ref to this sale order, and save it, I want to copy this field VBAK-ZZLATESTDATE to LIKP-ZZLATESTDATE. This needs to be done automatically, through a user-exit or any other enhancement available. I dont want to populate it on the delivery screen. I just want to save it in the delivery header table LIKP. How do I go about it?
Appreciate your help.Hi
First of all, you need that the copy relation will be 1 to 1, ie, don't merge two or more SO in one delivery. For this, check in VTLA the field or VOFM that you set in Combination Requirement.
Second, in tcode VTLA check in copy rules for the type SO to delivery. So, in VTLA in the field Header Data in transfers, create a copy of VOFM 001 (for instance 901) using VOFM 001 as a template and add this line.
LIKP-ZZLATESTDATE = CVBAK-ZZLATESTDATE.
See Note 327220 - VOFM function and its objects for further information related with VOFM.
I hope this help you
Regards
Eduardo -
I've a scenerio where i've to updated LIKP table, when user save the HUPAST. I've created the BDC program which update the likp table using VL02N transacton. but when i'm calling the BDC from a BADI its giving a error, as i'm trying to update the same delivery number. (Delivery already updated by user).
I'm now trying using events, i've traced an event CHANGED in object type LIKP , which is fired when HUPAST is saved.
How do i update the event changed ??? and call the bdc program from the event.
pls share .
Sanjuhi,
You can do it PAI under module USER_COMMAND. and you can use standard UPDATE/MODIFY/DELETE statements to update ur database table and make sure u use a commit work after the use of ablove mentioned statements.
kindly check this.
PROCESS BEFORE OUTPUT.
MODULE status_9010.
LOOP WITH CONTROL tab_control.
MODULE move_data_to_table.
ENDLOOP.
PROCESS AFTER INPUT.
LOOP WITH CONTROL tab_control.
MODULE move_data_from_table.
ENDLOOP.
*& Module move_data_to_table OUTPUT
This is to move the data from the internal table to the table control
MODULE move_data_to_table OUTPUT.
This is to move the data from the internal table to the table control
zmpets_mode-modecode,zmpets_range-rangeid,zmpets_servfacto-factor are column name of table control
READ TABLE int_factor INDEX tab_control-current_line.
IF sy-subrc = 0.
zmpets_mode-modecode = int_factor-modecode.
zmpets_range-rangeid = int_factor-rangeid.
zmpets_servfacto-factor = int_factor-factor.
ENDIF.
ENDMODULE. " move_data_to_table OUTPUT
*& Module move_data_from_table INPUT
Date is moved from the table control to the Internal Table
MODULE move_data_from_table INPUT.
To move the data from the table control to internal table 'INT_FACTOR'.
int_factor-modecode = zmpets_mode-modecode.
int_factor-rangeid = zmpets_range-rangeid.
int_factor-factor = zmpets_servfacto-factor.
*here if the data is there, it will modify
MODIFY int_factor INDEX tab_control-current_line.
IF sy-subrc NE 0. "data not exixting in table control . ie new data, then append it
APPEND int_factor.
CLEAR int_factor.
ENDIF.
ENDMODULE. " move_data_from_table INPUT
Also refer to this link:
http://help.sap.com/saphelp_nw2004s/helpdata/en/9f/dbac5e35c111d1829f0000e829fbfe/content.htm
<b>Reward points if found helpful ..
Cheers,
Chandra Sekhar.</b> -
Using sd_salesdocument_change to update vbak-lifsk
Hi all,
I want to update vbak-lifsk based on some conditions using the function module sd_salesdocument_change. Could anyone of you who has done something similar help me with some tips and code snippets?
Helpful posts WILL be rewarded.
KJust pass the order number and set ORDER_HEADER_IN-DLV_BLOCK to your new value and ORDER_HEADER_INX-DLV_BLOCK to 'X'. Also set ORDER_HEADER_INX-UPDATEFLAG to 'U'.
PARAMETERS: p_order LIKE vbak-vbeln.
DATA: ord_in LIKE bapisdhd1,
ord_inx LIKE bapisdhd1x,
t_ret LIKE bapiret2 occurs 0 with header line.
ord_in-dlv_block = '01'.
ord_inx-dlv_block = 'X'.
ord_inx-updateflag = 'U'.
CALL FUNCTION 'SD_SALESDOCUMENT_CHANGE'
EXPORTING
SALESDOCUMENT = p_order
ORDER_HEADER_IN = ord_in
ORDER_HEADER_INX = ord_inx
TABLES
RETURN = t_ret
LOOP AT t_ret WHERE type = 'E'.
ENDLOOP.
IF SY-SUBRC <> 0.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
ENDIF.
Message was edited by: Michael Malvey -
How to update Sales Order Delivery Block while saving Delivery ?
Hi,
I have a requirement wherein i need to update sales order delivery block field(VBAK-LIFSK) while saving the delivery for the order.
Also I need to remove this block while execution of Backorder Rescheduling program SDV03V02 (Tcode : V_V2),
Can anybody help me out in this?
regards,
NitinHI,
try using BAPI_SALESORDER_CHANGE
pass ur vbeln in SALESDOCUMENT
pass an 'X' to BAPISDH1-DLV_BLOCK
and 'X' to BAPISDH1X-DLV_BLOCK
Also add the UPDATE task clause, you will want to set the flag only when delivery is being saved, not before that. -
Plant Field from Delivery Header
Hello Gurus,
I am trying to understand what is the Plant (WERKS) field on the Delivery Header(LIKP). Where else is this Plant (WERKS) stored in SAP Tables. I do not want to take it from the LIKP table because of a limitation. So can anyone help me if this field is available in any other table in SAP.
Thanks,
Jayaswy KotaHi Pranava
check this tables in se12
MARA-General Material Data
MARC-Plant Data for Material,
MARD-Storage Location Data for Material,
EBAN-Purchase Requisition
EINE-Purchasing Info Record: Purchasing Organization Data
EKBE-History per Purchasing Document
MKPF-Header: Material Document
hope clear your issue.
Regards,
Krishna. -
Update Schedule line Delivery date using Bapi_po_Change
Hi all,
I am using Bapi_po_change to Update the Schedule line Delivery date(EKET-EINDT) for the PO based on the Item and the Schedule line.
I am passing the PO number, Po header, Item structure, Schedule line Structure.
But the Date is not getting updated in the Eket table.
Please suggest.Hi Sukriti,
Thanks for the Response, yes i have used the Bapi Transaction Commit Also .
The point is I am able to Update the Statistical Delivery Date in the Same EKET table using BAPI_PO_Change .I have Checked all the Ways to update the EKET-EINDT(Delivery Date)but no Unable to do it. -
Link between Delivery Header & Sales Order Item for extraction to 2nd level
Hi Guys ,
I am having a requirement that need to pull the following data to 2nd level DSO
1. Delivery Header Data
2. Sales Order Item data. ( Sales Document, Item, Item RDD, Material)
So I am planning create a 2nd level DSO on top of Delivery header and need to pull the sales order ITEM level data ( Sales document , Order ITEM, ITEM RDD date , Material) through start routine u2026
How can I pull the Sales Order Item data through start routine? i.e I need the link between Delivery Header & Sales Order Item Data .
or I need the link between LIKP ( Delivery Header) Vs VBAP ( Sales Document Item).
Thanks
Edited by: krismady on Sep 22, 2010 2:26 AM
or I need the link between LIKP ( Delivery Header) Vs VBAP ( Sales Document Item).Hi Krish,
You can use VBLEN (Sales Document) to link Delivery header DS (2LIS_12_VCHDR) and Delivery item DS (2LIS_12_VCITM). Now In delivery item DS (2LIS_12_VCITM) you have VGBEL (Reference doc.) and VGPOS (Reference item) which is nothing but sales order document number and sales item in Order item DS (2LIS_11_VAITM) .
So you need to link in above way to get other values in your DSO.
It is proven method.
Thanks,
Uday Shankar. -
Hello every one,
We have a plant assigned to multiple storage locations(A,B) and we have different printers at both the str.locations.(1,2)
Output procedure is assigned to the delivery header.
when ever i use storage location A it should print on printer 1
and
when i use storage locaiton B it should print on printer 2.
Storage locaiton details are stored at the delivery item level.
how can i separate the printers based on the storage location and print the doc from delivery header?
Configurations, development or requirements.... please advice
Thanks in advance
SumanthHi Sumanth,
If you already have plant and storage location in key combination to set the condition record, you just need to maintain the printer name into "Communication" data of condition record in tcode "VV22".
If you don't have plant - St Locn in key combination you'll need
1) Maintain the condition table for fields plant, storage location and delivery type. (path SPRO>LE>shipping>Basic functions>Untruth control>O/P determination>O/p determination for o/b delivery)
2) Assign newly created table to the access sequence which is assigned to condition type. (path SPRO>LE>shipping>Basic functions>Untruth control>O/P determination>O/p determination for o/b delivery-->Maintain Access Sequence)
With above setting you'll be able to maintain condition record with the new key combination and then can maintain the printer 1 for plant "A", st locn "B" and delivery type "LF". Also can maintain printer B for combination "A", "C" and "LF".
Hope this will help.
Regards,
Sudhir -
Goods Movement and Updation of outbound delivery.
Hi,
I am using BAPI_GOODSMVT_CREATE to do a transfer posting with movement type 411K.After doing the posting I am updating the outbound delivery for the PO using BDC recording.
The problem is that after doing the transfer posting when I try to update the outbound delivery with picked quantity and picked date it is giving an error that "Article (the article number) is blocked".Due to this the outbound delivery is not getting updated.
Could you please help me to understand why I'm getting the error and how to eliminate it? Need your help urgently.
Thanks,
Sandeep.Hello Shashank,
Thanks for your reply.
Please let me know do these bapis mentioned by you fulfill my requirement.
Any sample code u have to use this bapis.
Regards,
Tarun
Maybe you are looking for
-
I had iCloud installed, and it was working, then I wanted to increase font size in the notes section of Calendar. I read to uninstall iCloud and reinstall iCloud and it would be fixed. Once I reinstalled iCloud it did not show up in Microsoft Office
-
How to adjust upper and lower printer margins?
I want to be able to print a 5x7 photo on an A4 sheet so that I can fold it to make a greeting card. Therefore I need to be able to set the top and bottom margins independently like you can in Photoshop. How can I do this? I am using an Epson Stylus
-
Alert Monitor: Selection On Product Number
Hi experts, I want to maintain an alert profile and try to enter several single product numbers in the selection dimensions. But I can only enter 18 values in the column "value from" - that's it. Does anybody knows how can I enter more single product
-
New To Mac, How to move/copy files from external drive
Just got my first Mac computer. My music files (about 140 gb) are on an external drive. When setting up iTunes the process of transfering and organizing the files took over 24 hours--more than twice as long as on my old PC. I would like to keep the f
-
How do I move an image to a new layer
I'm hoping someone could help. I need to move just one image from a picture to a new layer with a white background. I have tried everything and can't get it to work. If anyone could help with this, I would appreciate it-thank you.