Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to populate the quantity field of S/4HANA sales order line items with code

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

This article is about how to use the code to fill in the quantity field of S/4HANA sales order line items, the editor thinks it is very practical, so I share it with you. I hope you can get something after reading this article.

My task is to generate the line items of the S/4HANA sales order (Sales Order) with code and populate the corresponding quantity (quantity) value.

At first, I used the following code to write the value of quantity into the item field target_qty:

Ls_order_items_in-item_categ = 'TAN'.ls_order_items_in-material =' REDUCER_A'.ls_order_items_in-target_qty = 999.ls_order_items_in-itm_number = 10.ls_order_item_x-item_categ = 'X'.ls_order_item_x-material =' X'.ls_order_item_x-target_qty = 'X'.ls_order_item_x-itm_number =' X '. Ls_order_item_x-updateflag =' I'.APPEND ls_order_item_x TO lt_order_item_x.APPEND ls_order_items_in TO lt_order_items_in.

Found that it does not work after execution.

After studying a line item that maintains the correct quantity, it is found that the quantity field is actually maintained on the schedule line of item:

And the order quantity that we see on item, which is clearly seen in the F1 help documentation, is a cumulative value, the sum of all the quantity of schedule line.

So the correct code would also be to create a schedule line for item:

Ls_schdlin-itm_number = 10.ls_schdlin-req_qty = 3.ls_schdlinx-itm_number = 'X'.ls_schdlinx-itm_number =' X'.ls_schdlinx-updateflag = 'X'.APPEND ls_schdlin TO lt_schdlin.APPEND ls_schdlinx TO lt_schdlinx.

The complete code is shown in the following figure:

The above is how to use the code to fill in the quantity field of S/4HANA sales order line items, and the editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report