Tuesday, July 7, 2020

Goods Movement against Production Order

There are two types of goods movement against production order which impacts the inventory of the material. These movements are done through movement types in SAP.

  • Goods Receipt (GR) against Order is executed with movement type 101 which is done when we produce the material. After goods receipt, the system increases the stock of the material at the relevant storage location.

  • Goods Issue (GI) against Order is executed with movement type 261 which is done whenever we consume the component materials to produce some other material. After a goods issue, the system decreases the inventory of the components at the relevant storage location.

Create Goods Receipt against Order

Step 1) From SAP Easy access screen open transaction MIGO

  1. Select Goods Receipt as you are going to do goods receipt.

  1. Select Order as you are doing goods receipt against production order.

  1. Enter your Production order number.

Goods Movement against Production Order in SAP PP: MIGO

After filling in all the fields, click Goods Movement against Production Order in SAP PP: MIGO or press Enter to go to the next screen.

Step 2) In this Screen

  1. Check movement type "101" which is relevant for GR against Order.

  1. If the material is subject to quality inspection, then you will see the stock type as "quality inspection".

  1. If the material is handled in batches, then enter the batch number in which inventory will be updated.

Goods Movement against Production Order in SAP PP: MIGO

Step 3) In the same screen,

  1. Enter the date of manufacture, i.e., the date when the material was produced.

  1. Check the flag of "Item Ok ".

  1. Click the "check" button on top and you will see the message at the bottom of the screen.

Goods Movement against Production Order in SAP PP: MIGO

Click Goods Movement against Production Order in SAP PP: MIGO to save the document. The system will show a message like Goods Movement against Production Order in SAP PP: MIGO

Create Goods Issue against Order

In SAP PP, goods issue takes place when the raw material is consumed to produce material as per Production order. When goods are issued, the system decreases the inventory of components at the storage location in the Production Planning system.

Movement type 261 is used for goods issues.

To perform goods issue, use T-code: MB1A or go to Logistics → Production → Production Control → Goods Movement → Goods Issue

Enter the following details −

  • Movement type 261 for goods issue

  • Plant and Storage location

If you want to print, select the checkbox for print.

Click the To Order…button at the top of the screen as shown in the following screenshot −

Enter Goods Issue

Enter the following details −

  • Order no. and click Adopt Details.

  • Input materials in the Material column

  • Required quantities for each material in the Quantity column

  • Unit of measure KG in UnE column

  • Respective storage location in the column SLoc

Reference Order

Click the Adapt button. You will see the following details. Click the save icon to save the details. You will get a confirmation that the document has been posted.

Enter Goods New Item


Information “Document 56754500001” posted.


Thursday, June 25, 2020

SD: Create Picking, Packing & Post Goods Issue

What is Picking?

Picking will create Transfer Order if we use WM link to Delivery. When transfer order is confirmed. Then the field picking quantity is turn on to enter.


If no WM is created, we have to input the quantity of picking manually.

 

It is necessary to prepare the correct quantity and quality of  goods  as specified in sales order for shipping on schedule as required by the customer. Material picking is done by warehouse management (WM). WM picking is done via transfer order. The transfer order is the  basis for the picking list, it is used to withdraw the ordered goods from stock. There are three ways of picking-

  1. Pick Delivery individually.

  2. Picking can be scheduled to run at per-defined intervals.

  3. SAP SD module can be configured to execute picking automatically.


Pick can be automatic (full).

What is Packing?

Packing function is used to exchange product data between suppliers and customers. The packing of product is done by the packing material. These packing materials need to be created in the material master with material type “VERP”. Packing can we done in SAP  in two ways:

  1. Manual Packing

  2. Automatic Packing

There are many Steps in packing function like manual packing and auto packing with single level and multilevel packing.

 

Packing will create a HU (Handling Unit). Packing is manually created.

  • Pack material

  • Pack HU

 

Packing material has 2 types:

  • Return packing material

  • Non-return packing material

if there is price in packing material, it will add price into billing.

 

Picking & Packing is not mandatory, when there is WM it is mandatory. To check the mandatory, go to delivery in tab Picking, check OverallWMstatus or WMActStatus to check whether WM is used.

What is Post Good Issue (PGI)?

Post goods issue is the last Step of delivery/shipment processing. Herein, ownership of the goods transfers to the customer and the stock is updated. The carrier in turn transfers the ownership to the final customer once goods are delivered.

Schedule line will define which GoodsMvt in PGI.

Steps for Picking ,Packing and PGI are as below

  1. Create outbound delivery with reference to sales order.

  2. Create a picking request.

  3. Creating Packing.

  4. Create PGI.

Step 1) Create Outbound delivery

  1. Enter T-code VL01N in command bar.

  2. Enter Shipping Point.

  3. Enter Selection Date and sales order.

Create Picking, Packing & PGI (Post Goods Issue): SAP LT03, VL02N

Click on save  Create Picking, Packing & PGI (Post Goods Issue): SAP LT03, VL02Nbutton.

A message "Delivery 80016014" has been saved.

Create Picking, Packing & PGI (Post Goods Issue): SAP LT03, VL02N

 

Step 2) Creating Picking Request

  1. Enter T-code LT03 in command field.

  2. Enter warehouse Number / Plant / Delivery and press enter.

Click on save  Button.

A Message" Transfer order 0000002638 created" will be displayed.

Create Picking, Packing & PGI (Post Goods Issue): SAP LT03, VL02N

 

Transaction 

  Step 3) Create Packing  

  1. Enter T-code VL02N in command field.

  2. Enter outbound delivery no, which was created earlier.

  3. Click on Pack button.

 

In the next screen,

  1.   Select Tab "Pack material"

  2.   Enter Packaging Materials, then press Enter, related information of Handling Unit will be automatically filled.

Create Picking, Packing & PGI (Post Goods Issue): SAP LT03, VL02N

 

3. Select Pack button to pack the material

Click on save button.

Step 4)  Post Good Issue (PGI).

By PGI (Post Goods Issue) the ownership of the material or goods will be changed from company to the customer.

  1. Enter T-code VL02N in command field.

  2. Enter Outbound Delivery number.

  3. Click on Post Goods issue Button.


A message "Replenishment dlv. has been saved" is shown. When we do PGI , two documents will be created:

  • Material document (Regarding stock reduction)

  1. Enter T-code MB03 in command field and Enter sales order no in sales order field and execute the report.

  2. Material document will be displayed .

Create Picking, Packing & PGI (Post Goods Issue): SAP LT03, VL02N

  • Accounting document (Cost of goods sold will be credited and stock value will be debited.)

  1.  Enter T-Code S_ALR_87014387 in command field.

  2.  Enter Material code.

  3.  Click on execute button.

 


Monday, June 22, 2020

Pagination in ADB Form

When you select a table, the Pagination tab in the Object palette displays several pagination options. In the pagination tab, following options are to be available:

Place

Determines where the table/subform will be placed. Possible options are described as follows.

Following Previous

Lays down the table/subform after the previous object in the parent subform.

In Content Area > [name_of _content_area] 

Lays down the table/subform in the specified content area.

Top of Next Content Area 

Lays down the table at the top of the next content area.

Top of Content Area > [name_of _content_area] 

Lays down the table at the top of the specified content area.

On Page > [name_of _page] 

Lays down the table on the specified page (introduces a page break if one does not occur naturally).

Top of Next Page 

Lays down the table at the top of the next page (introduces a page break if one does not occur naturally).

Top of Page > [name_of _page] 

Lays down the table at the top of the page, whenever the specified page is rendered (introduces a page break if one does not occur naturally).

On Odd Page 

Places the subform on pages that are set to print on odd pages.

Top of Next Odd Page 

Places the subform at the top of the odd page whenever the specified page is rendered (introduces a page break if one does not occur naturally).

On Even Page 

Places the subform on pages that are set to print on even pages.

Top of Next Even Page 

Places the subform at the top of the even page whenever the specified page is rendered (introduces a page break if one does not occur naturally).

Keep With Previous

Keeps the table within the same content area as the previous table.

Keep With Next

Keeps the table within the same content area as the next table.

After

Determines which area to fill after the table is placed.

Continue Filling Parent 

Continues merging data for all objects remaining to be filled in the parent subform.

Go to Next Content Area Starts filling the next content area. For example, area1 of Page1

If this option is chosen, after the subform objects finished to be filled, it will go to next content area (next page)

Notice

if the body page/ subform height is more than the content area, you will get a blank page.


Solutions:

Bind each body page to an Master page




Go To Content Area > [name_of _content_area] Starts filling the specified content area.

Create each master page link to each content_area


Go To Next Page Starts filling the next page.

Go To Page > [name_of _page] Starts filling the specified page.

Go To Next Odd Page Starts filling the next odd page.

Go to Next Even Page Starts filling the next even page.


If dataset must be paginated

Overflow

Sets an overflow for a table that spans pages. See To set up a table to span multiple pages .

None Starts filling the next page (introduces a page break if one does not occur naturally).

Go To Content Area > [name_of _content_area] Starts filling the specified content area.

Go To Page > [name_of _page] Starts filling the specified page.


Overflow Leader/Trailer

Because the length of an interactive form containing subforms that are set to flow content can vary depending on the amount of data displayed in the form, the form often has more than one page. As a result, you may want certain subforms (sections) in the form to continue on subsequent pages.

Using overflow leader and overflow trailer subforms, you can designate different subforms to precede and follow repeating or expanding subforms that are likely to carry over to additional pages. Overflow leaders and trailers are special types of subforms that you can use in form designs that have a flowable layout. After you specify a subform as an overflow leader subform in the Binding tab of the Object palette, the subform appears at the top of each new page.

For example, you can use the heading row at the top of a table as an overflow leader subform. Placing the heading row at the top of a table ensures that it is repeated at the top of each new page, making the information in the table rows easier to read and follow from page to page.

Similarly, you can assign an overflow trailer subform to follow the last occurrence on a page of a repeating or expanding subform that could possibly span multiple page

Example

Subform Hierarchy

Letter subform

Header Subform (repeated for each page)

Table Subform


Sunday, June 21, 2020

8. AMDP

AMDP stands for ABAP Managed Database Procedure 


An ABAP programmer can create a HANA database procedure (SQLScript code block accepting parameters) without directly interfering with SAP HANA database.


This procedure has an ABAP Data Dictionary entry as a DDIC object and can be transported using TMS transport requests.


AMDP procedures and AMDP class methods can only be created and developed in SAP HANA Studio.

Demo 1: Creating AMDP Procedure using SAP HANA Studio with ABAP 

Step 1: Create ABAP class in SAP HANA Studio

Finish. 


The default ABAP code for our new class will be displayed and ready to be edited. 

This class is not an AMDP class yet. It is still an ordinary ABAP class definition. 


Step 2: In order to convert an ABAP class into an AMDP procedure class, the interface if_amdp_marker_hdb interface must be implemented as follows: 

This interface defines the class as an AMDP class, allowing you to implement AMDP methods

that is, ABAP methods that call a SAP HANA database procedure from within a global ABAP

class.

Step 2: Create AMDP method.

The AMDP methods must be passed by value instead of by reference, it is to avoid the procedure ends with error and reference parameter is changed unexpectedly.


A red mark appears the left side of the code editor indicating that the implementation is missing for this new AMDP method. 

Click on the red mark >> Click on Add implementation for new method. 

Now you can activate your AMDP class. 

Step 3: Implement AMDP method 

Add the following code lines into your AMDP method. Please note that the HANA database tables used are listed after “using” phrase.

Now you have the following error: “The body of a database procedure cannot be empty”. 

Add the following SQLScript in your method implementation. 

This SQLScript statement reads BUTXT field into company_name parameter from T001

database table for the record that has BUKRS field value is equal to company_code parameter. 


Parameter in SELECT statement

  • If a parameter is used as a comparison value in WHERE clause, developers should add “:” in front of the parameter name. 

  • If developers want to assign a value to the parameter, the target parameter will be placed in double quote sign “” and written in capital letters. 


This is our first AMDP class with one method using parameters. 

Comment in SQLScript

For commenting code, “--“ is used at the beginning of a related line. 

Step 4: Create a sample ABAP program that can consume HANA AMDP class methods

Enter name and description of ABAP program. 

Enter the following lines of code into your program. 

In CATCH section of TRY-CATCH block, if any problem occurs in HANA database procedure,

the AMDP class returns an exception where the ABAP programmer can get details of the error. 

Demo 2: AMDP Procedure + CRUD 

Step 1: Implement AMDP class

Remember to include raising exception part in AMDP class definition for catching error which 

may happen during modifying database table process. 

Step 2: Create Program to test 

Demo 3: Analyze AMDP performance

Copy database table into ZTABLE 

Add columns into table ZSNWD_SO_I that you are going to use AMDP and ABAP program

 update for the performance comparision.  

Step 1: Create AMDP class 

  • if_amdp_marker_hdb defines the class as an AMDP class, allowing you to implement AMDP methods - that is, ABAP methods that call a SAP HANA database procedure from within a global ABAP class.

  • if_oo_adt_classrun allows you to output the results to the ABAP Console.

Step 2: Execute AMDP class

Enter your values for parameters>>Run

Step 3: Analyze AMDP Profiling 

Select method to execute 

Input value for parameters>>Run

After the execution is finished, go to ABAP Profiling Perspective

Go to ABAP Traces tab>>Refresh Trace Entry>>Double click on your performed Trace Entry

Refer to the following link to work around different tools in AMDP Profiling. 

https://archer4sap.com/2018/02/04/abap-profiling-with-eclipse-adt/

Step 4: ABAP program 

Result: 

According to the above summary, my program had to be terminated due to the excess of runtime and the necessity of workspace for other users. 

I was trying to reduce the number of records that need to be selected from database. The ABAP program was tested with three different inputs of number of records (100,000 records, 500,000 records, and 1,000,000 records). The following image shows the result of runtime measurement for these three test cases. 

 

Step 5: Compare ABAP program’s runtime with AMDP class’s runtime 

Several lines of code need being added into our AMDP class in order to measure the runtime of the class. 

The date time function nano100_between calculates the interval between two point of time. The result is measured in nanoseconds, hence you need to multiply it to 0.001 to get the new result in microseconds. 

The following image shows three test cases that I implemented for my AMDP class. 

As you can see from the summary, AMDP class enables us to update the whole database table which caused dump if the normal ABAP program is being processed. 

Solution: Use parameters to pass in the number of records into your program

Creating AMDP Function using SAP HANA Studio with ABAP 

Refer to CDS Table Function’s document and source code. 


REFERENCE:



Goods Movement against Production Order