quinta-feira, 20 de outubro de 2022

INVOIC IDoc processing of Intercompany billing (IV)

 Recently has some enhancement works on Intercompany billing with standard output type RD04 which will create output which type is ‘Invoice Receipt MM’ and generate an inbound IDoc ‘INVOIC’ to create an accounting document. I write down the basic processing which deeply integrated with IDoc and hopes it could help if someone faces the same. But actually, it’ll work as a warm-up for me to recall memory when dealing with potential subsequent issues~ : D

1. About RD04 output

After Intercompany billing been saved and go to Header->output to check the output processing log at VF03 with the Intercompany billing number. Btw, one wiki document explains the whole setting related to RD04 very well.

The process logs contain key details with driver program ‘RSNASTED’, the routine name ‘EDI_PROCESSING’ ( both are standard and can check at RD04 output setting by NACU as well), and the inbound Idoc number.

Go to WE05 with the Idoc number to check RD04 generated IDoc details which provide the generated accounting document number at status ’53’.

Go to WE20 using the above Idoc attributes like partner No., partner type, port, basic type, and message type, then get the key Function Module: IDOC_INPUT_INVOIC_FI which is the inbound handler. (Although using customized process code here, still it’s standard FM).

2. About Inbound FM ‘IDOC_INPUT_INVOIC_FI’

The main FM for ‘IDOC_INPUT_INVOIC_FI’ is ‘PROCESS_IDOC_INVOIC_FI’ which contains a single FM: ‘zwischenstr_zuordnen_invoic01′ which will post accounting document using the BDC method. That’s why we can re-run this Idoc inbounding process by SE19 and debug this in the front end like a pure BDC session.

The enhancement for this FM is ‘FEDI0001’, there’re several FM user exits available. From my understanding, the two categories here for EDI processing:

  • ‘MM-EDI’ is MM involved could be Invoice Verification related Accounting posting;
  • ‘FI-EDI’ is the only pure FI Accounting Document posting.

I’d like to use ‘CALL CUSTOMER-FUNCTION‘ to search at this include program LIEDIF4S, then find out user exit ‘101’ against FM: ‘EXIT_SAPLIEDI_101’ which can be used to manipulate the data before accounting document posting.

Then just modify the internal table ‘document_data’ contents inside the include program ZXF06U06 will achieve any data replacement you want for account document posting.

The table ‘DOCUMENT_DATA’ been populated line after line at the major loop per Idoc segments like e1edk01.

The contents inside table ‘beleg_daten’ which against DOCUMENT_DATA look like this:

Exactly the same as the BDC sessions’ data for FNAM and FVAL! For example, if need to update the order number by using field BSEG-AUFNR(may not good idea~), will get an error like below during posting cause store as BSEG-AUFNR doesn’t mean the field at BDC input screen use the same~

 

 

Check the correct field at the FB03 screen or you can ask the function to help to record one BDC session by SHDB if not sure where it’s.

Search ‘COBL-AUFNR’ inside the main program of the FM, will find routine: fill_user_exit_kontierungen impact the value of COBL-AUFNR.

By using the where-used list, get another user exit: EXIT_SAPLIEDI_002 (FI-EDI: Invoice Receipt – Determine Add. Acct Assignm. per Line Item). Just add custom code at include ZXF06U02 will do.

The above process is inbound for posting account documents, sometimes maybe it’s better to modify the IDoc segment contents before it’s been generated. Then we need to check its preceding procedure which is Idoc generation during RD04 output controlled by FM: IDOC_OUTPUT_INVOIC_IV_MM.

3. About IDoc Filling FM: IDOC_OUTPUT_INVOIC_IV_MM

The main routine to populate segment fields is ‘FUELLEN_IDOC_INTTAB’ which contains several sub-routine to populate per Idoc segment.

Search interested segments structure name to identify the routine name, then search text ‘customer_function’ to identify its user exit FM. Below is the user exit for E1EDP01.

Will find FM like ‘EXIT_SAPLVEDF_002’ which maps to ‘002’ of enhancement ‘LVEDF001’ for Customer Enhancement in Data Segments Billing Document Output. Then do the custom code to manipulate the segment filling process.

About Debug Idoc related to RD04

Reprocess existed inbound Idoc by BD87 will not generate new IDoc but WE19 will do, so BD87 can’t debug the Idoc when been processed successfully. Only possible for traffic light with yellow or red color. WE19 will be better than BD87 for this case.

To test the inbound process FM: ‘IDOC_INPUT_INVOIC_FI’, just use SE19 with Inbound FM and check the box of ‘Call in debugging mode’. And do remember to tick in foreground mode which will be very convenient with data the per-screen just like the BDC session.

A good watch-point for trace changes of document fields is BELEG_DATEN-FVAL:

 

To test the RD04 Idoc filling FM: IDOC_OUTPUT_INVOIC_IV_MM, one easiest way is using the program RSNAST0D.

One tip about G/L account replacement:

  • If you want to change the G/L account before IDoc been generated, using the included program ‘ZXEDFU02’ of FM: ‘EXIT_SAPLVEDF_002’.
  • But be cautious that the system will validate this new G/L account again using table T076I and change it to another G/L account if no maintenance entry for your G/L account.
  • If that is the case, then have to use included program ‘ZXF06U06’ of FM: ‘EXIT_SAPLIEDI_101’ to manipulate the value of the G/L account after Idoc been generated and wait for system validation completed and before the document been posted.
  • You can use the parameter field ‘IDOC_DATA_INDEX’ to monitor changes inside the internal table ‘DOCUMENT_DATA’ and DOCUMENT_LINE to separate various account items with posting keys BSEG-BSCHL!
Source: https://blogs.sap.com/2021/04/25/invoic-idoc-processing-of-intercompany-billing-iv/

Some Important Information about SAP Authorization Objects as a Functional/Technical Consultant

 Introduction

One of the biggest reason SAP has been successful is because it is very Secured and Auditors love it as it has all the components of SOX System.

What is Authorization Object?

An authorization enables you to use certain functions in the SAP System. Every authorization relates to an authorization object and defines a value or values for each authorization field contained in the authorization objectAuthorizations are grouped into profiles that are entered in the user master record.

In this Blog we are going to discuss the following.

  1. How to Find Authorization Object Associated with a Transaction Code in SAP?
  2. How to know Authorization Object of anything by just the Name in SAP?
  3. How to get Authorization Object by Process Area in SAP?
  4. How to get all the Activity Authorization Object in SAP can Function?
  5. How to find the different Activity types for Authorization Object?

 

Solution

 

  1. How to Find Authorization Object Associated with a Transaction Code in SAP?

Go to SE16N Transaction Code

Please Provide Table TSTAVT

Provide the Transaction Code or Transaction Codes you want to Check. Below example shows we are checking ME21N

Here are the below entries.

The above list only shows the Auth Object Assigned in SE93 Transaction Code.

In order to get the Authorization object assigned not in SE93 and also assigned use Table USOBT

 

 

Here is the result for VA01

 

 

 

 

  1. How to know Authorization Object of anything by just the Name in SAP?

Go to SE16N Transaction Code

Please Provide table names TOBJT

 

Search with *Plant* wildcard

Here are the below Entries

  1. How to get Authorization Object by Process Area in SAP?

Go to Transaction Code SU21

 

Now Search with Purchase Order and here we get the Authorization Object

  1. How to get all the Activity Authorization Object in SAP can Function?

Go to SE16N Transaction Code

Please provide table name as VTACTZ

Please provide the below entry

Below we get all the Activities that is possible for the Authorization Object.

  1. How to find the different Activity types for Authorization Object?

Go to SE16N Transaction Code

Please provide table as TACTT

Now enter the following entry as we wish to see in English

Here are all the possible Activity Types available

Conclusion

The above blog is Applicable for both SAP ECC and SAP S/4HANA

Below is the video version

  1. How to Find Authorization Object Associated with Multiple Transaction Code in SAP?

  1. How to know Authorization Object of anything by just the Name in SAP?

  1. How to get Authorization Object by Process Area in SAP?

  1. How to get all the Activity Authorization Object in SAP can Function?

  1. How to find the different Activity types for Authorization Object?

 

 Source: https://blogs.sap.com/2020/11/14/some-important-information-about-sap-authorization-objects/

Exploring ABAP Debugger [1] : Save Debug Session

 This is first post of a new series Exploring ABAP Debugger where I will talk about ABAP debugger features and try to compare them with Eclipse wherever possible.

I personally like the GUI ABAP debugger a lot and prefer it over Eclipse Debugger and I hope that Eclipse Debugger will get better with time.

In this post, you will learn about saving a debug session and loading the saved session. This feature is only available in GUI ABAP debugger and not in Eclipse Debugger.

1. Consider that you have set up multiple break-points.
2. Use the menu option Debugger > Debugger Session > Save .

A pop up screen ‘Save Current Debug Session’ appears. Here, select the checkbox for breakpoints and provide new name in session name.

You can also save Watchpoints, debugger settings and Layout etc as well.

3. Take a break. Log out, log in again.
4.  Load the session using Debugger > Debugging Session > Load .

Note that you can also save the session to a file instead of database.

5. The breakpoints are loaded.

This is not a very popular feature and I have found that very few ABAP developers are aware of this. Do let me know in the comments whether you were aware of this and whether you find this useful.Advertisements

Visit ABAP Debugger page to see more articles on debugging.


If you like the content, please consider subscribing to the blog.

Source: https://discoveringabap.com/2021/11/07/exploring-abap-debugger-1-save-debug-session/

terça-feira, 11 de outubro de 2022

How to find email address of SAP User id the smart way?

 Introduction

In most Projects you will work in SAP there will be a requirement to find the following

  1. Find SAP User id from Email address
  2. Find Email Address from SAP User id.
  3. Find Full name of a SAP User Id
  4. Find Full name of Email address

 

Solution

With the introduction of out of the box CDS View you can find all the email addresses from SAP User Id with just one Select Statement.

The CDS View is PUSER002.

Go to SE11–> Enter Table PUSER002

 

You can check the field available after Displaying the CDS View

Now we can find the Full Name of user as well as email address attached to SAP User Master. Currently the SAP Email address that is maintained in PA0105 table for SAP User ID in Communication Infotype seems to be same in User Master in SU01D transaction Code.

 

 

Conclusion

You can use this solution in SAP ECC as well as SAP S/4HANA.

You can also create a Search help for this as this will make life easier for SAP End user and Consultants.

 

Video Version Below

 Source: https://blogs.sap.com/2022/09/18/how-to-find-email-address-of-sap-user-id-the-smart-way/