quarta-feira, 7 de setembro de 2022

How to Test BAPI Function Module in SAP?

 Introduction

As a SAP Consultant at some point of your career you will use BAPI. There is special way to test a BAPI whether it is really useful for you to call in your Program.

 

Solution

In our example we will be using BAPI_PO_CHANGE to change some fields in PO Line Item.

Now we will fill the Parameters and save it as a Test Data

Below is the Saved Test Data Entry

Now we go back to SE37 and follow the below path

We will put the following Function Modules.

Now we execute based on the saved Test data

After Executing we will hit Back Button and this will call the Commit Function Module

BAPI_TRANSACTION_COMMIT is called and we execute

Now executing is completed and the Database has commited.

 

Conclusion

We can use this Blog for both SAP ECC and SAP S/4HANA

 

Below is the video version

 

Also check how to Find BAPI

 

 Source: https://blogs.sap.com/2020/09/06/how-to-test-bapi-function-module-in-sap/

How to Remove Negative Entries from Customer Credit Master and SAP Table – S066 and S067

 Hello Everyone,

The following process will shed light on how to remove negative values shown in the Credit Management tables S066 and S067 and as well as shown in Customer Credit Master.

Problem Statement:

The issue is that negative values are shown in the Credit Management Tables – S066 and S067 – as well as in the Customer Credit Master. Due to this, the finance department of an organisation is not getting the correct credit exposure and details of open sale orders and deliveries of the customers. The system is allowing the creation of customer sale orders while the customer’s limit is over. Due to negative values, the system is not recognising the correct credit exposure.

Solution:

To overcome the above problem the following solution is as under to remove negative values from Table – S066 and S067 and also from Customer Credit Master.

 

Step-1:       Run the standard program RVKRED77 in T code-SE38 and place the customer number in the field of Credit account as per the below screenshot.

Step-2:         Go to Programme Menu—-> Click on Execute in Background as per the below screenshots.

Step-3:         After clicking on “Execute in Background” the following screen will be displayed. On this screen, write “LP01”  and click on the tick .

Step-4:         After clicking on the tick on the previous screen, the following screen will be displayed, also on this screen click on the tick icon.

Step-5:         After clicking on the tick on the above screen, the following screen will be displayed. In this screen, first, click on “Immediate”, then “Check” and finally click on the “Save” button.

Step-6:         After “Save” on the previous screen, execute T code-SM37 to check the status of the Credit re-org running programme. After executing T code-SM37, the following screen will be displayed, and click on the “Execute” button.

Step-7:         After executing the button on the above screen, If the status of the program/job shows “Active”, on the next screen then press the “Refresh” button on the upper left-hand corner of the screen. If the status shows “Finished”, it means the job has been completed successfully.

Step-8:         When the status is “Finished” as per the above screen, then execute program RVKRED88 in SE38to fetch the details of open orders and delivery. Please put the customer number and press on the “Execute” button as per the below screenshot.

Step-9:         After executing the button as per the above screenshot, the detail of open orders and deliveries will be shown related to the customer.

To Conclude:

Once the above steps will be executed successfully the business will get the correct credit exposure of the customers to avoid any dispute in the future related to over-invoicing due to wrong credit exposure.

Suggestion:

To avoid any risk in Production system, instead to run both programs RVKRED77 & RVKRED88 directly in SE38, business can make Z T-codes to run this program in production system and give authorization to respective user for these T-codes to run these program.

Please follow Neeraj Jain for more content on issues & topics related to SAP Sales & Distribution and Material Management.

If any questions please click here

Thanks for your interest! Please share feedback, comments or suggestions below.

Best Regards,

Neeraj Jain

SAP Lead Consultant in HCL Technologies Limited

Source: https://blogs.sap.com/2022/09/06/how-to-remove-negative-entries-from-customer-credit-master-and-sap-table-s066-and-s067/

Debugging F110 (Automatic Payment)

 

Introduction

If you ever tried do debug the automatic payment program (F110), you had realized, it’s not that easy like at other SAP programs. The reason is, F110 creates a background job, where the payment items are processed. There are a handful of ways, to debug your payment job, in the following I will describe one of them. Let’s dive into it and learn, how to do it …

How to debug F110

Breakpoint for XDEBUG

First of all, to be able to activate debugging for F110, you need to change a variable at the payment program. Run SE38 and navigate to program F110MAIN and search for XDEBUG.

set%20break-point%20the%20change%20XDEBUG%20variable

set breakpoint the change XDEBUG variable

Create a breakpoint to stop at this program line.

Job Scheduling

Next step, you have to schedule your payment job into the future. This is necessary, to be able to run the background job in debugging mode.

schedule%20automatic%20payment

schedule automatic payment

 

Background Job Debugging

Once, the background job is scheduled, run SM37, select your created F110 job and run command JDBG into the command-field. The same function can be selected under menu Extras / Debug Job.

select background job and run job debugging

Activate Debugging

The job will start immediately. Continue with F8 and the debugger will stop at your breakpoint created before.

Now you have to change the variable XDEBUG to “X”.

Debug

Now you can run the program to your code of interest, which you want to debug.

Final words

You can not debug F110 as easy as other SAP programs, but with a little bit of extra work, you get it done without any problems.

If you have any questions, feel free to use the comment section below

Source: https://blogs.sap.com/2020/09/23/debugging-f110-automatic-payment/

SAP TM Integration with LBN for Freight tendering

 Shippers, Manufacturers use this business process to send freight requests for quotation (freight RFQs) to carriers. Carriers can accept or decline these freight RFQs and change data such as the price when they return the freight quotations. Shipper can then automatically accept the tendering and send the freight order back to the awarded carrier. You can define a timeout in the system so that the system either tenders the freight order to another carrier or switches from one tendering type to the next. The tendering process results in one carrier being selected to execute the freight order.

Typical Tendering Process between TM and LBN is explained using below flow chart:

Note:

  • This integration is between TM and LBN Freight Collaboration
  • SAP standard Web Service communication is used via SOAMANAGER configuration for integration between TM <-> LBN.

This process runs as follows:

  1. Start tendering from TM Freight order

You start the tendering process. The process can be initiated by selecting an existing tendering profile. The tendering steps can also be created manually and stored as a tendering template. The process can involve the following:

  • Definition of price limits and time limits
  • Assignment of visibility settings (determines whether a carrier is allowed to change prices and dates)
  • Perform peer-to-peer tendering

The system sends the freight RFQs or freight orders one after the other to the specified carriers.

  • Perform broadcast tendering

The system sends the freight RFQs to all carriers simultaneously.

  1. Create RFQ from TM system– Send out freight requests for quotation (freight RFQs) to one or more carriers, according to a tendering plan.
    • You can send the freight RFQs manually
    • You can enable the system to send freight RFQ’s out automatically.
    • You can also use a direct tendering process to send a road freight order (road FO) directly to a specified carrier without creating a freight RFQ. Carriers can confirm or reject the road FOs. Unlike the freight RFQ process, the system generally awards a carrier if he or she does not reject the road FO within a given time limit.

Direct tendering can be created and started manually by the user, or automatically by the system.

  1. Carrier Acceptance or Rejection of a Freight Request for Quotation via LBN
    • Quotation that was created in Step2 must have received into LBN.
    • A carrier must respond to the sold-to party within the time limit given in the freight request for quotation (freight RFQ). The carrier must accept or reject the freight RFQ before the response time ends.
    • Open the application ‘Freight Requests for Quotation’ in Carrier tenant LBN portal
    • Carrier can see Tendering Quotation received into LBN
    • Carrier can Accept / Reject / Accept with changes

 

  1. Evaluation of Freight Quotations in TM system
    • If the Carrier response is Accept, Response code is ‘Accepted and Evaluation pending’ against the Tendering Quotation Request in TM system.
    • If the carrier response is Reject, then RFQ status is updated as rejected and a new RFQ can be initiated again.
    • Shipper can evaluate freight quotations immediately after carrier has responded them.
    • Tendering manager Evaluates FQs to detect that the maximum response time for a RFQ time is over.
    • Additional evaluation criteria:
      • Lowest price
      • Carrier who commits to stop date
      • Fastest carrier
    • To evaluate the RFQ process automatically in TM system, program /SCMTMS/TEND_CONT_PROCESS can run in foreground / background as a batch job.

  1. Award a freight quotation in TM system
    • Immediately after Freight quotation is awarded to a carrier, following information is updated in freight order.
    • Selected carrier
    • Submitted price
    • Charge hierarchy
    • Confirmed stop dates and times

 

The system sends the freight order as a transportation request to the carrier. The carrier can receive the transportation request on the mobile device using SAP Transport Tendering.

In this step, Tendering is Awarded to carrier and sent for confirmation to Carrier.

After awarding to carrier, Status of RFQ is updated to Awarded in TM Freight order.

  1. Carrier confirmation from LBN portal
    • After Shipper awarded it to carrier, Freight order is received in to LBN for confirmation from Carrier.
    • Carrier login to LBN portal in respective carrier tenant -> Open the application ‘Freight Orders for Confirmation’ to see if any freight orders waiting for confirmation.
    • Carrier confirm the shipment, and then shipment execution can began as per the requested dates.

Pre-requisites:

  • Customizing settings for tendering
  • A tendering plan
  • Define freight order types that are relevant for subcontracting.
  • Carrier BP in TM
  • LBN Carrier tenants
  • LBN Shipper tenant
  • SAP Standard Web Service SOAMANAGER configuration between TM <-> LBN
Source: https://blogs.sap.com/2022/09/06/sap-tm-integration-with-lbn-for-freight-tendering/

terça-feira, 30 de agosto de 2022

Configuring HTTP Content Server (2) – Save printed document (1/2)

 I will not speak about installing and configuring the HTTP Content Server, there is already very good documentation about it. Here we will see how to use the content server to store printed document.

For the example, I will used the Sales Order in an IDES Server.

Configuring the output

The configuration of the output is done using the transaction NACE.

/wp-content/uploads/2014/01/nace_1_362099.png

To configure Sales Order output, you have to select the Application “V1” and press the button “Output types”

/wp-content/uploads/2014/01/nace_1_362099.png

The standard Output Types for the sales order is BA00, I will use it.

Select the Output type in the right part, and double click on “Processing routines”.

/wp-content/uploads/2014/01/nace_1_362099.png

The configuration of the Output type “BA00” for printing is this one. Program “ZSD_RVADOR01” and Smartform “ZSD_SALES_ORDER”.

Now we could open a Sales Order and check if the message BA00 works.

Transaction VA02.

/wp-content/uploads/2014/01/va01_1_362126.png

Press the button “Print preview” to display the default output type :/wp-content/uploads/2014/01/va02_4_362135.png

/wp-content/uploads/2014/01/va02_5_362136.png

The Smartforms works (good).

To display witch output type was used, you have to go in the menu :

/wp-content/uploads/2014/01/va02_2_362127.png

/wp-content/uploads/2014/01/va02_3_362128.png

This output is yellow because it’s not already processed. Print preview doesn’t process the message, even if you print during a preview !

To configure the automatic creation of this message you have to configure the transaction VV12.

/wp-content/uploads/2014/01/vv12_362137.png

(in your system, you could have several key combinations, for example to be able to specify the printer by plant / sales org / …)

if you go in detail of the condition record you will see something like this :

/wp-content/uploads/2014/01/vv12_362137.png

In this doc, we will try to use the option of the last parameter :

/wp-content/uploads/2014/01/vv12_362137.png

Configure the archiving of the Sales order

A long preparation for a quick configuration ..

Define document type :

Transaction OAM1, go in the menu :

/wp-content/uploads/2014/01/oam1_362832.png

(or directly using transaction OAC2)

/wp-content/uploads/2014/01/oam1_362832.png

I specify to the system to save the document in PDF format. I could set “*” if I will be able to store PDF, Word, Excel, …

Define the links

Transaction OAM1, go in the menu :

/wp-content/uploads/2014/01/send_362319.png

(or directly using transaction OAC3)

The key corresponding to Sales Order is VBAK :

/wp-content/uploads/2014/01/oam1_362832.png

In the OAC3 trans. we specify for this kind of document to store the document in the ContentRepository Z1 and to use the link table TOA01.

(You could use 99 link tables TOA01 -> TOA99)

Save it

Test

Now, we come back to the configuration of the output type in the VA02 transaction.

(menu : Extras -> Output -> Header -> Edit)

/wp-content/uploads/2014/01/oac3_362327.png

Select the line and Click on the button “Communication method” and select “Print & Archiv”

/wp-content/uploads/2014/01/oac3_362327.png

(don’t forget to set with the button “Further Data” : “Send immediately” )

Back and Save.

Result

In transaction VA03, go in the output type.

/wp-content/uploads/2014/01/oam1_362832.png

Select the line and go in the menu :

/wp-content/uploads/2014/01/oam1_362832.png

With Sales order you will have a popup like that, but with others transaction like Invoice you won’t.

/wp-content/uploads/2014/01/oam1_362832.png

Double-click on the document will open you an internet browser :

/wp-content/uploads/2014/01/oam1_362832.png


Source: https://blogs.sap.com/2014/01/13/configuring-http-content-server-2-save-printed-document-12/

SD & EDI Transactions

 

Transactions

  • search_sap_menu - Finds the menu path to a transaction - Can either type in TX code in the search criteria or a description- ie. 1st try SE38 and then ABAP.... the returned result is 'bottom to top'.

  • VOE1        Translation between EDI categories and SD item categories

  • VOE2        Table EDSC view. Customer link to sales area detail

  • VOE3        Table view EDPVW. Add partner types that will be transferred to the IDoc

  • VOE4        Table view EDPAR. Link external partner number with our internal number

  • WEDI        EDI Administrator Menu

  • BALE        Idoc Administration

  • OVA9        Create entries for each sold-to customer for which you will receive EDI schedule releases.  At implementation, the only field that needs to be maintained is "Check PO number," which causes SAP to make sure that the PO number sent on the release matches the PO number on the schedule agreement. This transaction updates table T663A.  SAP will not post an EDI schedule release, if this record is missing.

  • OVAI         Create entries for each Vendor / Partner description combination.  (Vendors must match sold-to Acct. at Cust., and Partner descriptions must match ship-to Partner descriptions.) This transaction updates table T661W.  SAP uses this table to determine the schedule agreement sold-to partner.

  • OVAJ        If you would like SAP to post schedule requirements using discrete dates only, instead of weekly and/or monthly buckets, you can indicate the days of the week that you deliver to this customer.  SAP will divide the customer's quantity for a week or month evenly into the days of the week specified by the distribution function code.  This code must be sent in the DELINS IDoc in field E1EDP16-ETVTF.

  • WE09 / WE02    IDoc lists according to content. View IDocs via specific IDoc number or business application detail contained within the contents of a segment.

  • WE05        View IDocs

  • WE19        EDI test tool. Use to test inbound Function module changes.

  • WE20        Partner profile configuration. Add partner detail together with inbound and outbound relationships. We also incorporate message control on the outbound IDocs. Utilize the organizational units to trap functional errors for further processing

  • WE30        Create IDoc extension type

  • WE31        Segment create

  • WE57        Assign function module to logical message and IDoc type

  • WE60        IDoc type documentation tool

  • WE82        Link Release detail to Extension IDoc Type

  • BD55         Conversion rule user exit. Link conversion rule user exit to the different system \ partner combinations

  • BD87         Reprocess IDocs in error or waiting for action. (Both inbound and outbound in 4.6. Use BD88 in prior versions)

  • BALA        ALE Application Distribution

  • BALM        ALE Master Data Distribution

  • V/36          Maintain output determination for deliveries (Output determination procedures). V10000 (Header output) has condition type LAVA (usually with requirement 1 NB: Use V/84 – V7ALLE – SHAD for grouped ASNs. I.e. Group deliveries into shipments

  • VV21,VV22,VV23          Create output condition records for shipping. LAVA – WE (Partner function) - We must add each new partner with VV21

  • VL71         Reissue output for deliveries

  • V/54          Maintain access sequence for billing documents

  • VV31,VV32,VV33          Create condition records for billing documents. (RD00 – RE Billing party)

  • VF31         Reissue output for billing documents

  • V/30          Sales document output types (BA00)

  • V/48, V/32, V/43            Maintain access sequence for sales documents

  • VV11,VV12,VV13          Create condition records for sales documents. (BA00 – SP Sold to party)

  • V/27          Create code to check requirements for output control. Used to check ZBA0 against BA00 output.

  • VA02         Sales order change

  • VA05         List of sales orders

  • VA22         Quotation change

  • VA32         Scheduling agreement change

  • VA42         Contract change

  • VF02         Change billing document

  • VF11         Cancel Billing document

  • VF04         Billing due list

  • FBL5N       Display Customer invoices by line

  • FBL1N       Display Vendor invoices by line

  • VL02N       Change delivery document

  • VL04         Delivery due list

  • VKM5        List of deliveries

  • VL06G       List of outbound deliveries for goods issue

  • VL06P       List of outbound deliveries for picking

  • VL09         Cancel goods issue

  • VT02N       Change shipment

  • VT70         Output for shipments

  • VKM3, VKM4    List of sales documents

  • VKM1        List of blocked SD documents

  • VD52         Material Determination

  • SWEAD     Event queue administration

  • SWE2        Event type linkages

  • SWE3        Event linkages

  • PPOME     Organizational Unit Maintenance

  • SWE5        Consistency Checks for Event Linkages

  • SWUD       Workflow Diagnostic Tool

The following section provides detail on other useful SAP areas.

Once the order is saved proceed through the following steps. The process assumes the item has values in the warehouse bin.

  • VL04         Delivery due list. Run the delivery due with your order number to create the delivery

  • LT03         Create Transfer Order. EG. Warehouse: 101 and enter. Picking background. Save

The Transfer order should now be saved. It now needs to be confirmed.

  • In LT03 go to menu option Transfer Order -> Confirm – Transfer Order
  • Enter
  • Save

The transfer order is now confirmed.

  • VL02N       Delivery change. EG: Edit the delivery to do the following Pack – External customer material number = COO. External delivery number – Waybill number. BOL – Transport tag. Carrier – Header partner – SP (E.G. FXP). Tracking number = Packing Unit

  • ME22N      PO Change

  • ME57        Create PO from purchase requisition

  • MIGO        Post goods receipt

  • MD04        Material Requirements. Shows material requirements and releases against materials

  • SE38         ABAP Editor. Used to modify ABAP programs

  • SM01        Transaction list. Lock transactions in the system. Also a good tool to see what transactions are available

  • SHDB        Transaction recorder (BDC)

  • CMOD       User exit \ project tool. Coordinates your changes into projects for the purpose of activating all user exits for a particular project. A user exit needs to be modified before it will work

  • SE16         Table contents display

  • SOST        View mails sent externally from SAP

  • SU53         Check authorization object

  • SQVI         Table Quickviewer – Used to created quick client dependent reports

  • ST22         ABAP Dump Analysis

  • ST01         System trace

  • ST11         Display developer trace

  • ST05         SQL Trace

  • SM21         System log

  • ST22          Display short dumps

  • SM12         Display locked entries 

Programs

  • RBDAPP01       Post inbound Idocs to application documents

  • RBDAGAI2        Re-processing of IDocs after ALE input error

  • RBDAGAIE       Reprocessing of edited IDocs

  • RBDMANIN       Start error handling for non-posted Idocs

  • RSEINB00         Idoc inbound processing by file

  • RSEOUT00       Process outbound IDocs

  • RV80HGEN       Report 'RV80HGEN' for including customer-specific routines in the SAP standard source code is not included automatically as an XPRA in the object list of the transport request. See OSS note 0385067. This report needs to be run in target clients once you have implemented a custom requirements definition.

  • RSWUWFML    Report that interrogates the Workflow inbox, based on certain selections, and then forwards a notification to the respective users that they have email waiting in the SAP system. The auto-forwarding assignment of an email address to a user can be accomplished by the administrator and tx: SO36 or by the user themselves using tx: SO13. Use tx: SOST to view email status’ sent from SAP.

  • RHSOBJCH      Corrects the following error in workflow customizing:

Transport object PDST

Information Table SOBJ is consistent as regards key tables

***Error*** Table HRP1600             Not an entry in table SOBJ

Information Table SOBJ is consistent as regards PAD tables

See note 134311 (point 2). Note 60801 also recommends the same steps regarding RHSOBJCH.

  • RSPO0075 Run report RSPO0075 to activate access method M for device types.

Source: http://www.swsc.net/db/sap/doc_page52.html