0% found this document useful (0 votes)
5 views

FAQs_Interface

Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

FAQs_Interface

Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 5

Interfaces:

1. Types of interface you worked?


- a) App. Server file
b) BAPI
c) Proxy file
d) IDOCs

2. How to read application server file (AL11)?


- Using OPEN DATASET IN INPUT MODE.

3. How to write XLS file to application server file?


- Using OPEN DATASET IN OUTPUT MODE with file extension XLS.
- Similarly for TXT/CSV.

4. How do you handle if there is an invalid symbol in AL11 file?


- We use exception handling and UNICODE conversion.

5. What is the keyword to print the data in AL11 directory?


- TRANSFER is the keyword.

6. What happens if I don't use EXIT in DO & ENDDO while reading AL11 file?
- LOOP will not be ended (infinite LOOP).

7. How do you identify if the file does not exist in specified folder in AL11?
- After OPEN DATASET, we check SY-SUBRC = 0, if not 0 then file does not exist or
invalid.

8. How do you convert the AL11 file into SAP format?


- Generally AL11 file will be having a separator for each field,
so based on the separator we can use SPLIT command and move to SAP internal
format.

9. Which technique you use to update AL11 file data into SAP?
- It depends on situation, If the file data is less and dont have sufficient time
for the development then we go for BDC.
Otherwise we can prefer BAPI.

10. What will happen if I dont use CLOSE DATASET statement?


- The file will be remain opened and if you want to delete the contents of the file
in the next run it will not allow to access the file.

11. How do you validate the presentation server file is valid or not?
- We can use a FM or class method to validate the i/p file path.

12. Can we schedule a background job for presentation server file?


- We use a FM or class method to upload a file and if the FM/method allows you to
upload file for
then we can run,
otherwise we cant schedule.
Ex. GUI_UPLOAD does not support background process.

13. What are the modes for OPEN DATASET?


- 1. BINARY MODE
2. TEXT MODE

14. What is the meaning of ENCODING DEFAULT?


- Defines the character representation in which the content of the file is handled
and defualt it UTF-8.
UTF-8 for 1 byte and UTF-16 for 2 byte mode.
UTF - Unicode Transformation Format
A(Char)->065(ASCII CODE)->01000001(BYTE).

15. What is the difference between TEXT & BINARY modes?


- TEXT is to place the file in char format.
BINARY is to place the file in bit & byte format.

BAPI:
-----
16. What is BAPI?
- Full form of BAPI is Business Application Programming Interface and it's a RFC
FM.

17. What is the difference between RFC and BAPI?


- Every BAPI must be a RFC function module but every RFC may not be a BAPI.
If a RFC FM is converted & create business objects and registered into BOR
(Business object repository) using SWO1 tcode then we call it as BAPI otherwise its
just a RFC.
We can handle exceptions in RFC but in BAPI we can't handle exceptions directly
instead we have RETURN parameter.

17A) 43. What is the difference between BAPI & RFC?


- Every BAPI is a RFC function module but we call it as BAPI when it is
converted into BOR (Business Object Repository) otherwise it is just a RFC.
All BAPIs are available in BAPI transaction but RFCs will be available in
SE37.
Every BAPI must be followed by COMMIT otherwise changes won't be saved.
We can use exceptions in RFC whereas we use BAPIRET2 (return parameter) in
BAPI for error messages.

17B) How to know the errors using bapi while uploading data?
Ans.
A BAPI should be able to record and classify all possible errors that may occur a
function Module BAPI_MESSAGE_GETDETAIL is used to handle the Error Messages.
You have to create a parameter named Return for every BAPI. This parameter
returns exception messages or success messages to the calling program.
BAPIs themselves must not trigger any messages (such as MESSAGE xnnn) in
the coding. In particular they must not generate terminations or display dialog
boxes. Instead, all messages must be intercepted internally and reported back to
the calling program in the Return parameter. Otherwise the BAPI will not be
processed correctly and control may not be given back to the calling program.
All error messages or indeed any message that may be returned by the BAPI, must
be defined in message table (Tools ® ABAP Workbench ® Development ® Programming
environment ® Messages) and described in the documentation for the return
parameter. This also applies to the most important or most likely error messages
generated by other programs that can be indirectly passed via the BAPI to the
application program.

You must not use exceptions in BAPI interfaces.


When a termination message (message type A) is triggered, a database rollback is
executed in the standard programming model, that is, all tasks performed since the
last COMMIT WORK are canceled. When you program BAPIs, we recommend that you also
execute a database rollback in the return parameter for termination messages. You
must describe this process in the documentation for the Return parameter. For
messages of type E (error), the calling program performs the error handling.
Application developers are provided with two service BAPIs to diagnose and process
error messages from BAPI calls:
BapiService.MessageGetDetail () displays the short and long texts of BAPI error
messages.
BapiService.ApplicationLogGetDetail (), with which information in application logs
can be displayed.

Features
The export parameter Return can be implemented as follows:
As a structure, whereby it must be defined in the function module as an export
parameter, as well as in the method in the BOR.
As a table, whereby it must be defined in the function module as a table parameter,
as well as in the method in the BOR as an export parameter.
Before filling the Return parameter you should either initialize the structure with
CLEAR or the table with REFRESH and CLEAR.
If the return parameter is not set or is set to an initial value this means that
no error has occurred.
The Return parameter may be based on the following reference structures:
BAPIRET2
You must use this reference structure when developing new BAPIS.
BAPIRET1, BAPIRETURN
These reference structures are still partly used in old BAPIs.
Both structures must be filled in the logon language.

18. How do you find a BAPI?


- a) Search with BAPI_* in SE37
b) Check in BAPI transaction for the required functional area
c) Google it.

19. Why do we need to use COMMIT for a BAPI?


- Initially BAPI works for simulation mode and to reflect the changes into database
we should use COMMIT WORK.

20. Can we test BAPI independently (without a program) with COMMIT functionality?
- Yes, Execute SE37 -> Menu -> Execute in sequence -> Provide required BAPI name
and followed by COMMIT BAPI.

21. How to handle custom fields of a transaction using BAPI?


- Every BAPI contains EXTENSIONIN paramter, so pass the enhanced strcture name and
the concatenation of Z-fields data to VALUEPART1 of EXTENSIONIN.
1. Create the .APPEND structure with the required custom field to the DB table in
SE11.
2. Add the logic to populate the custom fields in SE38 program.
3. Fill the BAPI EXTENSIONIN param with structure name and valuepart1.
Valuepart1 will have custom fields data into concatenated string format.

22. What is the RETURN paramter type of BAPI?


- It's same for all BAPIs, i.e BAPIRET2.

23. Can we use multiple BAPIs in a program?


- Yes, But every BAPI must be followed by COMMIT.

24. Have you created any BAPI ever?


- Standard SAP has given BAPIs for every business transactions with
Create/Change/Delete/Get functionalities.
I have not created any BAPI but I have created RFC.

25. What is the diff between COMMIT WORK and BAPI_TRANSACTION_COMMIT?


- COMMIT WORK -> Updates the database.
BAPI_TRANSACTION_COMMIT -> Updates the database and refreshes the changes (COMMIT
+ REFRESH).

26. What is the diff between BAPI vs BDC?


BDC: 1. Through BDC data will flow & update DB via screens.
2. Less amount of data we prefer BDC.
3. We have control on data validations or changing data etc.
BAPI: 1. Updates Data Base Tables directly.
2. Huge amount of data.
3. Less control on data validations and change.

27. What is the Business Object Repository?


- The Business Object Repository (BOR) is root access point for the SAP business
object types and their BAPIs.
The BOR was developed for SAP Business Workflow using SWO1 transaction.

28. Explain the steps to create a BAPI?


- 1. Create structures in SE11
2. Create the RFC function module in SE37
3. Create the business object in SWO1
4. Validate the created BAPI in BAPI Explorer
5. Test the BAPI.(BAPI tcode)

29. What is BAPI***X structures?


- It's the flags structure to confirm what field to be updated in the structure.

30. How to find BAPI extension structure names?


-. Open the respective BAPI in SE37 -> Goto attributes tab -> Copy the package
Goto SE11 -> Select Data type button -> provide structure name as BAPI_TE* (TE -
Table Extension) -> Click on F4 -> Click on structurs -> Click on new selection ->
Provide Package
Identify the respective structure name (header, item, etc..)

Proxy:
-----
31. Explain about PROXY?
- PROXY is a middleware between SAP to NON-SAP vice versa.
PI team will generate a proxy class with required structure parameters
respectively for inbound and outbound using tcode SPROXY.
As an ABAPer we use this proxy class and it's method for our requirement with
ABAP logic.

32. How do you know the data is transferred to 3rd party or not?
- We will receive the response from 3rd party to PI and PI to SAP.

33. How do you send the response to 3rd party?


- From SAP side we will fill the exporting parameter of proxy class method and rest
PI will take care.

34. When we go for PROXY process?


- When we want to connect 3rd party frequently and to make execution automatic with
security then we go for PROXY,
otherwise we can go for App server or IDOCs.

35. How do you handle the exceptions in PROXY?


- If it's a connectivity issue then PI team will take care of it.
If it's a data issue then we can handle using exception class.
Ex. CX_AI_SYSTEM_FAULT.

36. Business users have access to AL11?


- Generally AL11 access will be restricted, in exceptional cases display access can
be granted.

37. How do handle authorization for a program or tcode?


- We can create authorization object in SE54 tcode.
BASIS will add the users (to their profiles) to this authrization group in SU01.
We can add this authorization group:
a. SE38 -> Program attributes.
b. SE93 -> While Create Transaction.
c. SE38 -> Using ABAP code
AT SELECTION-SCREEN.
AUTHORITY-CHECK OBJECT 'S_CARRID'
ID 'CARRID' FIELD carr
ID 'ACTVT' FIELD '03'.
IF sy-subrc <> 0.
MESSAGE 'No authorization' TYPE 'E'.
ENDIF.

38. How do you request for authorization roles?


- I will execute the transaction and check.
If I don't have access then I will go to SU53 tcode and take the screenshot of
it and send to BASIS for the authorization.

39. What is the Difference between SProxy and Idocs?


- Standard Idocs are already provided and you can use them directly while Proxy you
will require to write the code on ECC side.
IDocs may not be available for certain transaction process then we prefer to go
with proxy to implement customized logic.

40. What is your preferred option among all file process options?
- If customization required then Proxy is the preferred option.
If standard process then IDOCs is best option, IDOCs can capture step by step
status of the process.
We can have a copy of the data from both the sides SAP and NON-SAP systems.

Note - IDOCs FAQs will be released in a separate set.

You might also like