Skip to Content
avatar image
Former Member

help on creating a generic ds by calling a FM ?

We have a requirement to get the char value name through FM. I need to create a new generic datasource which calls the FM " CONVERSION_EXIT_ATINN_INPUT" and fetches the result and pass it to BI.


Can anyone give me a sample program or link or document for the same. What this FM does is, just passes the ATINN values and gets the text /characteristic value for this field...so we need to pass the result of this FM to BI. I think its enough if we can just code the FM using import and export using this FM. Hope I am clear.


Thanks

DR

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Nov 02, 2015 at 06:09 PM

    Hi,

    maybe you got the option to append new fields to the existing DS and or change field entries by Userexit:

    EXIT_SAPLRSAP_001

    EXIT_SAPLRSAP_002

    EXIT_SAPLRSAP_004

    its not like you can create a extractor and put this Function Modul to be used for extraction.

    you have to create your own function modul with a pre-defined interface for extraction and in this you can call CONVERSION_EXIT_ATINN_OUTPUT. so see what the interface has to be go to Transaction RSo2 and click F1 on field Function Modul.

    you would have to write your own extract-function-modul. i dont know if this is what you want. because i have the feeling, that you want to somehow copy an existing extractor and change the output of a single field. ... field ATINN. maybe changing your existing extractor is the better choice. 

    regards

    Stefan Seeburger

    here is the code of FM CONVERSION_EXIT_ATINN_OUTPUT:

    FUNCTION CONVERSION_EXIT_ATINN_INPUT.
    *"----------------------------------------------------------------------
    *"*"Lokale Schnittstelle:
    *"       IMPORTING
    *"             VALUE(INPUT)
    *"       EXPORTING
    *"             VALUE(OUTPUT)
    *"----------------------------------------------------------------------

       DATA:
         L_ATINN LIKE CABN-ATINN,                "internal no of charact
         L_ATNAM LIKE CABN-ATNAM.                "name of characteristic

    *........ read characteristic master ...................................

       if INPUT is initial.                                        "v 1391359
    *   no input -> no conversion
    *   SELECT on CABN would return first found entry
    *   with initial ATNAM (overwritings)
         exit.
       endif.                                                      "^ 1391359

       CONDENSE INPUT NO-GAPS.
       L_ATNAM = INPUT.
       SELECT ATINN FROM CABN INTO L_ATINN
         WHERE ATNAM EQ L_ATNAM.
         EXIT.
       ENDSELECT.

    *........ set internal number ..........................................

       IF SY-SUBRC IS INITIAL.
         OUTPUT = L_ATINN.
       ELSE.
         OUTPUT = INPUT.
       ENDIF.

    ENDFUNCTION.

    Add comment
    10|10000 characters needed characters exceeded

  • Nov 02, 2015 at 05:51 PM

    Hi Daniel,

    Function Modules like CONVERSION_EXIT_ATINN_INPUT and CONVERSION_EXIT_ATINN_OUTPUT are related to Conversion Routines. In this case those Function Modules belong to Conversion Routine ATINN.

    Function Module CONVERSION_EXIT_ATINN_INPUT converts from external format (on your screen) to internal format (in the database). Function Module CONVERSION_EXIT_ATINN_OUTPUT converts from internal format to external format. The corresponding INPUT and OUTPUT parameters have to be used. Not difficult to program.

    However, I cannot judge in which context you have to use such a Function Module. When using a Generic Extractor based on a Function Module, you do everything in internal format.

    Best regards,

    Sander

    Add comment
    10|10000 characters needed characters exceeded

    • Hi Daniel,

      Thanks for your explanation. I see two options to proceed.

      Option 1: Create a Generic Extractor based on table CABN

      Enhance the DataSource with an additional field to store the external value of field ATINN. In the coding you have to use Function Module CONVERSION_EXIT_ATINN_OUTPUT.

      Option 2: Create a Generic DataSource based on a Function Module

      This is a more complicated option but certainly possible. You will have to extract from table CABN. Also here you will have to define field which stores the external value of field ATINN.

      Please refer to e.g. document SAP BI Generic Extraction Using a Function Module for a detailed instruction how to create such a Function Module extractor.

      Best regards,

      Sander