Sunday, March 5, 2017

Field catalog not found in SAP ABAP

When we are Displaying the ALV GRID using SET_TABLE_FOR_FIRST_DISPLAY ,Some times we may get error message like 
'FIELD CATALOG NOT FOUND".
If you are using the below Function Module to create fieldcatalog, then make sure that the ZSTRUCT should be DataDictionary Object.
If you Create ZSTRUCT as local structure by using TYPES statement,You will get the error.

FM Signature:

CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'

EXPORTING

I_STRUCTURE_NAME = 'ZSTRUCT'    "DDIC object

I_INTERNAL_TABNAME = ITAB_OUTPUT   "Interanal table based on your requirement

CHANGING

CT_FIELDCAT = ITAB_FIELDCAT  "Field catalog ref to  lvc_s_fcat

EXCEPTIONS

INCONSISTENT_INTERFACE = 1

PROGRAM_ERROR = 2

OTHERS = 3.

RFC (Remote function call) in SAP ABAP



What is RFC in SAP system?

The RFC interface system enables function calls between two SAP systems, or between an SAP system and an external system.

How to use the RFC?

Step 1: you need to have RFC connection settings should be maintained in SM59.
Example -SAP systems (system 1:AX1 system 2:AX2).
If you like to fetch the data or a data operations or checks from AX1.
Then RFC should be created in AX1 system and that RFC you should call in AX2 system as per your requirement.

 How to create RFC destination?
  1. Go to Transaction SM59 (Display and Maintain RFC Destinations).
  2. From the menu bar, click Create.
  3. Enter the RFC destination, connection type, description, and then press Enter.
  4. Select the Registered Server Program radio-button; enter the program ID, gateway host, and gateway service.
  5. Save the RFC destination.
 How to create the RFC?

it is similar to the FM in SAP and the only difference is that- In the Attributes tab, select the Remote-Enabled Module radio button. 

·  Go to Transaction SE37 (Function Builder), enter the RFC name, and click Create.
·  Enter an existing function group under which the RFC will be created, a short description for the RFC, and click Save.
·  In the Attributes tab, select the Remote-Enabled Module radio button.
·  In the Import tab, enter the import parameters. These parameters are used for passing the external data to the function module.
·  In the Export tab, enter the export parameters.
·  In the Changing tab, enter the changing parameters.
·  In the Tables tab, enter the table names.
·  In the Exceptions tab, enter the exceptions to handle errors.
·  In the Source Code tab, enter the source code (logic) for the RFC.
·  Click the Activate icon on the toolbar to activate the function module.