Abap Code to populate source system id

Hi , so kind of All of you,
please help me, i have written the code in one to one mapping in transformation routine in BI 7,0 right click on zzsourcsys and go tp rule details. No syntax errors in the code but when i load there is no value populating to zzsourcsys . i have defined zzsourcsys as 12 char. can u suggest where it is going wrong, i checked in tools assignment of sourcesystem id is there in my system.
Abap Code
TYPE-POOLS: RSSM.
Data: G_S_MINFO TYPE RSSM_S_MINFO.
RESULT = G_S_MINFO-LOGSYS.
Thanks
Poonam Roy

You have to write the code (<b>in BI/BW</b>) in the transfer rule (<b>between Datasource transfer structure and infosource/info object</b>)
There the FORM begin with
[code]USING RECORD_NO LIKE SY-TABIX
    TRAN_STRUCTURE TYPE TRANSFER_STRUCTURE
    G_S_MINFO TYPE RSSM_S_MINFO
CHANGING RESULT TYPE /BI0/OIPERSON
    G_T_ERRORLOG TYPE rssm_t_errorlog_int
    RETURNCODE LIKE SY-SUBRC
    ABORT LIKE SY-SUBRC. “set ABORT <> 0 to cancel datapackag[/code]
GS_MIN_INFO structure RSSM_S_MINFO contains information on the request being processed.
<i>G_S_MINFO. This passes technical information about the data load request,
such as requesting user, request date and time, update mode, the handling of
duplicate records, error handling flags, parallel processing flags, and what data
targets to update.</i>
If tou want to use start-routine for optimization reasons and fill an empty field in transfer structure, the structure G_S_MINFO is available too.
[code]USING G_S_MINFO TYPE RSSM_S_MINFO
CHANGING DATAPAK type TAB_TRANSTRU
    G_T_ERRORLOG TYPE rssm_t_errorlog_int
    ABORT LIKE SY-SUBRC. “set ABORT <> 0 to cancel datapackage[/code]
And stay in FORM between limits :
[code]$$ begin of routine
$$ end of routine[/code]
Update RESULT in first case, and field(s) of DATAPAK in second case.
[code]RESULT = G_S_MINFO-LOGSYS.[/code] or
[code]LOOP AT DATAPAK INTO l_s_datapak_line.
  l_s_datapak_line-zzsourcsys = G_S_MINFO-LOGSYS.
  MODIFY DATAPAK FROM l_s_datapak_line.
ENDLOOP.[/code]
Regards

Similar Messages

  • ABAP code to connect 2 systems.

    Hi,
    My requirement is such that I need to read the data from a cube of one BI system and write it into the cube of another BI system.
    I am able to read the cube data through "RSDRI_INFOPROV_READ" function module.
    2 questions:
    1) Is the above solution possible?
    2) Is there ABAP code to connect 2 systems?
    Please help with some suggestions.
    Thanks,
    Pankaj

    You can call function modules in other systems using RFC - so you probably need to create a RFC wrapper function module for your 'RSDRI_INFOPROV_READ'. Then you can create/look up a RFC destination for the other system using SM59.
    All you have to do to call a RFC function in another system, is to add the destination to the function call (if the destination is setup up right):
    CALL FUNCTION 'ZRSDRI_INFOPROV_READ'
       DESTINATION 'DEST_NAME'

  • ABAP CODE TO POPULATE LOGICAL SOURCE SYSTEM

    Hi Friends please help me with the below
    1. Requirement : to Populate The system Date , Source System
    in BI for Each load request.
    1 Solution: I thought of writing the Start Routine for this but it is giving me error
    syntax Error: END METHOD MISSING?????
    2. Also I have requirement to populate 0sourcsys source system id, can any body help how to populate that.
    Thanks
    Poonam Roy
    ABAP Code.
    I have the End Method. what more to do.
    METHOD start_routine.
    *=== Segments ===
    FIELD-SYMBOLS:
    <SOURCE_FIELDS> TYPE tys_SC_1.
    DATA:
    MONITOR_REC TYPE rstmonitor.
    $$ begin of routine - insert your code only below this line -
    ... "insert your code here
    FORM STARTROUTINE
    USING G_S_MINFO TYPE RSSM_S_MINFO
    CHANGING DATAPAK type TRANSTRU
    ABORT LIKE SY-SUBRC.
    DATA: ZLOAD_DAT LIKE SY-DATUM
    ZZSOURSYS TYPE RSLOGSYS
    IF G_S_MINFO-DATAPAKID=1
    SOURCE_FIELDS-ZLOAD_DAT = SY-DATE.
    SOURCE_FIELDS-ZZSOURSYS = G_S_MINFO-LOGSYS.
    ENDIF.
    ABORT = 0.
    ENDFORM.
    ENDMETHOD.
    ENDCLASS.
    *-- fill table "MONITOR" with values of structure "MONITOR_REC"
    *- to make monitor entries
    ... "to cancel the update process
    raise exception type CX_RSROUT_ABORT.
    $$ end of routine - insert your code only before this line -
    ENDMETHOD.

    You have to write the code (<b>in BI/BW</b>) in the transfer rule (<b>between Datasource transfer structure and infosource/info object</b>)
    There the FORM begin with
    [code]USING RECORD_NO LIKE SY-TABIX
        TRAN_STRUCTURE TYPE TRANSFER_STRUCTURE
        G_S_MINFO TYPE RSSM_S_MINFO
    CHANGING RESULT TYPE /BI0/OIPERSON
        G_T_ERRORLOG TYPE rssm_t_errorlog_int
        RETURNCODE LIKE SY-SUBRC
        ABORT LIKE SY-SUBRC. “set ABORT <> 0 to cancel datapackag[/code]
    GS_MIN_INFO structure RSSM_S_MINFO contains information on the request being processed.
    <i>G_S_MINFO. This passes technical information about the data load request,
    such as requesting user, request date and time, update mode, the handling of
    duplicate records, error handling flags, parallel processing flags, and what data
    targets to update.</i>
    If tou want to use start-routine for optimization reasons and fill an empty field in transfer structure, the structure G_S_MINFO is available too.
    [code]USING G_S_MINFO TYPE RSSM_S_MINFO
    CHANGING DATAPAK type TAB_TRANSTRU
        G_T_ERRORLOG TYPE rssm_t_errorlog_int
        ABORT LIKE SY-SUBRC. “set ABORT <> 0 to cancel datapackage[/code]
    And stay in FORM between limits :
    [code]$$ begin of routine
    $$ end of routine[/code]
    Update RESULT in first case, and field(s) of DATAPAK in second case.
    [code]RESULT = G_S_MINFO-LOGSYS.[/code] or
    [code]LOOP AT DATAPAK INTO l_s_datapak_line.
      l_s_datapak_line-zzsourcsys = G_S_MINFO-LOGSYS.
      MODIFY DATAPAK FROM l_s_datapak_line.
    ENDLOOP.[/code]
    Regards

  • Finding messages sent through ABAP proxy in the source system

    Hi All,
    I have a Proxy to HTTP scenario, wherein the messages are landing up in error at reciever for some value in the payload.
    I tried to look for the messages in XI, hwever they have been successful thru it and are deleted now.
    Also I tried to look for the messages in the sender R/3 system in SXI_MONITOR, hwever i dont have the access to this tcode there.
    Is there any other way these messages can be looked for in the R/3 system?
    Regards,
    Diptee

    Hi All,
    I could not find the messages in the source system, they seem to have got deleted (as they are old).
    Also i was trying to achieve the requried in the production environment, and so needed to know if the messages can be looked for by any means other than the report 'Monitor for Processes XML messages'.
    Thanks a lot.
    regards,
    Diptee

  • How can i export my custom abap code from one SAP system to another

    is there a way to export my custom code to any other SAP system.
    not the same client or server. say for ex: i develop a code in my system remotely and want to provide the same for my client to export into their system.
    maybe same versions but diff systems.
    is there a way to save as binary file or something?
    pls advice.
    thanks

    Hello,
    Yes u can do it.
    In SE38 give ur report name and click display.
    Now u will see ur code.
    In the MENU follow the path:
    Utilities-->More Utilities --> Upload/Download --> Download.
    Now ur report can downloaded to any format of file.
    Ask ur client to upload ur report in the similar fashion..
    Cheers,
    Vasanth

  • Source System in Transformation

    Hi Experts,
    Here is my scenario. We have number of BW  Systems (RBW1 to RBW5 ) for each continental regions. All these should load data to one Global BW System ( GBW ). RBWs have ODSR1 to ODSR5  and all of it will be connected to DSOG1 in global system.
    Now the question is how do i make namespace value unique in GBW. I use Source System as an identifier. In the transformation how do i populate Source System Infoobject??
    Please help.
    Thanks,
    DV

    no need to enhance the DS.... you can write a filed level routine on it.
    create an infosource in between the IO and the transformations and include the filed... and write the filed level routine to that filed.
    You can use the below code to call the source system id .use the below FM...
    CALL FUNCTION 'RSDG_ID_GET_FROM_LOGSYS'
        EXPORTING
          i_source_system = l_sourcesystem
        IMPORTING
          e_soursysid     = RESULT
        EXCEPTIONS
          id_not_found    = 1.
      IF sy-subrc <> 0.
        RETURNCODE = 4.
        MESSAGE e087(r7) WITH l_sourcesystem INTO l_text.
        MOVE-CORRESPONDING syst TO l_s_errorlog.
       l_s_errorlog-record = RECORD_NO.
        APPEND l_s_errorlog TO g_t_errorlog.
      ABORT = 1.
      ENDIF.
    Edited by: prashanthk on Feb 24, 2011 10:59 AM

  • Convert abap code to HTML

    Hi Experts,
    Can any body tell me, how to convert all abap codes in my SAP system to HTML format for creating backup, in one go.
    Thanx
    Rajiv Ranjan

    HI,
    I don't know if it wil be of any help. But you could always convert a ABAP report into a TXT file
    DATA: I_LINES TYPE T_LINES OCCURS 1000.
    DATA: BEGIN OF I_TEXT OCCURS 1000,
            TEXT(72).
    DATA: END OF I_TEXT.
    Read the source code into the internal table
      READ REPORT ABAP INTO I_TEXT.
      Loop over the source lines
        LOOP AT I_TEXT.
        Setup Transfer
          MOVE C_ID_SOURCE TO S_SOURCE-ID.
          MOVE I_TEXT-TEXT TO S_SOURCE-LINE.
        Fill up download file
           MOVE S_SOURCE-LINE TO WA_LINES.
          APPEND WA_LINES TO I_LINES.
        ENDLOOP.
      CALL FUNCTION 'WS_DOWNLOAD'
           EXPORTING
              BIN_FILESIZE        = ' '
              CODEPAGE            = ' '
                FILENAME            = FILENAME
                FILETYPE            = 'ASC'
                MODE                = ''
              WK1_N_FORMAT        = ' '
              WK1_N_SIZE          = ' '
              WK1_T_FORMAT        = ' '
              WK1_T_SIZE          = ' '
              COL_SELECT          = ' '
              COL_SELECTMASK      = ' '
           IMPORTING
                FILELENGTH          = W_FILE_LENGTH
           TABLES
                DATA_TAB            = I_LINES
           EXCEPTIONS
                FILE_OPEN_ERROR     = 1
                FILE_WRITE_ERROR    = 2
                INVALID_FILESIZE    = 3
                INVALID_TABLE_WIDTH = 4
                INVALID_TYPE        = 5
                NO_BATCH            = 6
                UNKNOWN_ERROR       = 7
                OTHERS              = 8.
    Edited by: Jürgen Degraeve on Jan 15, 2008 3:52 PM
    Edited by: Jürgen Degraeve on Jan 16, 2008 6:42 AM
    Edited by: Jürgen Degraeve on Jan 16, 2008 6:49 AM

  • ERROR with Source System in BI

    Hi,
    I replicated the datasources from DEV to BI. They replicated just fine. I can even see it in BI. I then tried to activate the datasource (i created the datasource from a view ) but it gave me a run time error :
    ASSIGN_LENGTH_0 Short dump has not been completely restored..too big.
    I then tried to go into the source system and tried to activate that and it said:
    Source System DEV300 is inactive
    BI Unknown in system
    BI IDoc type ZSBC019 is not the same as source system IDoc type
    The following errors occured in the source syaytem:
    Entry in inbound table not found
    Entry in outbound table not found
    Result of the destination check: No authorization to logon as trusted system
    What could have went wrong?
    Thanks

    Did you try activating the source system in RSA1 ..right click and choose active.
    if this doesnt work then you might want to check the inbound and outbound entries in we20 transaction code for the source system. If you have authorization. Or you need to check with your BASIS to set that up for you.

  • How to Delete a Source System from BW System

    Dear All,
    I have a request to delete a UDC based source system from a BW system. Can you please let me know the steps to be followed to delete a UDC source system.
    It would be helpful if you provide steps to delete a SAP Source system also from a BW system.
    If there are any such documents for both the cases, please provide me the link.
    Thanks to all.
    Regards,
    Karthik
    Please search the forum before posting a thread
    Edited by: Pravender on Mar 11, 2011 6:19 PM

    Hi,
          Go to RSA1 T-code
          Click on source System on Left window
          select the Source System
          right click on it and Delete.
          click yes if you want to delete the PSA table as well
    Best Regards
    Obaid

  • ABAP Store ABAP code locally  on the disk

    Hello
       I have a question, how download the Web dynpro ABAP code from the SAP System.
    Could You give me a hint how to save code locally on the disk?
    Regards
    Wojtek

    I started from http://code.google.com/p/saplink/ .
    Then in http://code.google.com/p/saplink/wiki/pluginList I found the plug-in for ABAP Web Dynpro.
    It still in ALPHA status and to be honest I got trouble installing it (in fact there is the note:  But WDA plugin requires SAPlink 0.1.3 or greater).
    You should get it running because I can see the nugg file.
    Eventually ask navigate to the http://code.google.com/p/saplink/issues/list and the other pages of http://code.google.com/p/saplink.
    Sergio

  • How to write the ABAP code for Datasource Enhancment

    Hi Team,
                  Can you please help me how to write the code for the enhancement i have made to the standard datasource
    i have added the fields ZZPayer and ZZPayer_access.
    I just wanted to know how to write the ABAP code to populate the data for these fields.
    Regards,
    Pradeep P.

    Hi
    From a performance point of view would like to suggest a few changes :
    WHEN '<DS name>'.
      select zzfields from <table> into itab
      for all entries in c_t_data where <condition>.
      If sy_subrc = 0.
    loop at c_t_data assiging f_c_t_data.
    read itab into wa_itab where key = f_c_t_data-key.
    f_c_t_data-zzfield = wa-itab-zzfield.
    endloop.
    refresh itab.
    regards,
    aparna
    endif.

  • How to Stop at Source System's Abap Code from BI Infopackage Trigger

    Hi Experts,
    I have enahanced 2 fields to some standard data source, that fields data is comiong fine to RSA3 in Source system.
    i am not getting 2 fields data to BI  PSA, but that 2 fields data  i am getting at in RSA3 Tcode  source system.
    i have tried all the ways to get data to BI PSA, but no luck.
    so, while running infopacke from BI i need to stop  at  Source System's Abap code where i have wriiten the code for those 2 fields.
    so, please any  one can explain, how to stop at source system's Abap Code once i  trigger infopackage from BI.
    Regards,
    Nagaraju K.

    Hi,
    which data source on your working?
    master data or transaction data
    enter the TCODE- CMOD
    choose the project
    select the funciton exit - EXIT_SAPLRSAP_001 - Transaction data
                                        EXIT_SAPLRSAP_002 - master data attr
                                        EXIT_SAPLRSAP_003 - mster data text
                                        EXIT_SAPLRSAP_004 - master data hier.
    choose the include program - ZXRSAU01.
    go to source code tab -> go to change mode -> find the code will start form here
    EX- : when " ZLIS_13_VDITM
    if not required don't put break-point .
    just comment it code.
    Thanks,
    Phani.

  • Start Routine to populate the Logical Source System

    Hi Friends please help me with the below
    1. <b>Requirement</b> : to Populate The system Date , Source System
    in BI for Each load request.
    <b>
    1 Solution:</b> I thought of writing the Start Routine for this but it is giving me error
    syntax Error: END METHOD MISSING?????
    2. Also I have requirement to populate 0sourcsys source system id, can any body help how to populate that.
    Thanks
    Poonam Roy
    <b>ABAP Code.</b>
    I have the End Method. what more to do.
      METHOD start_routine.
    *=== Segments ===
        FIELD-SYMBOLS:
          <SOURCE_FIELDS>    TYPE tys_SC_1.
        DATA:
          MONITOR_REC     TYPE rstmonitor.
    <b>
    $$ begin of routine - insert your code only below this line        -</b>
    ... "insert your code here
    <b>
    FORM STARTROUTINE
    USING G_S_MINFO TYPE RSSM_S_MINFO
    CHANGING DATAPAK type TRANSTRU
    ABORT LIKE SY-SUBRC.
    DATA: ZLOAD_DAT LIKE SY-DATUM
    ZZSOURSYS TYPE RSLOGSYS
    IF G_S_MINFO-DATAPAKID=1
    SOURCE_FIELDS-ZLOAD_DAT = SY-DATE.
    SOURCE_FIELDS-ZZSOURSYS = G_S_MINFO-LOGSYS.
    ENDIF.
    ABORT = 0.
    ENDFORM.
    ENDMETHOD.
    ENDCLASS</b>.
    *--  fill table "MONITOR" with values of structure "MONITOR_REC"
    *-   to make monitor entries
    ... "to cancel the update process
       raise exception type CX_RSROUT_ABORT.
    $$ end of routine - insert your code only before this line         -
      ENDMETHOD.

    Hi,
    Check whether the formula is useful here than Routine. Because you can see the Sy-datum , source system( I Guess) fields as avaialable formula elements .
    With rgds,
    Anil Kumar Sharma .P

  • ABAP code to enhance a standard data source

    Hi BW experts,
    I am a novice in BW and I need to append a standard datasource <b>0DAT_SRC</b> with a field <b>FLD1</b> from table <b>TABL1</b>.Extract structure: <b>EX0001</b>.
    Can anybody please suggest how this can be done?I guess it requires some ABAP coding to be done in the conversion exits.
    <b><i>Many,many thanks in advance!!</i></b>

    Following are the steps to enhance Standard Data source.
    1. goto tc RSA6.
    2. Select the Data Source which you want to enhance.
    3. Select display Data Source (Ctr+f2)
    4. Double click on the Extract structure.
    5. click on the Append Structure.
    6. Add the required fieds starting with ZZ*.
    7. Avtivate the Append Structure.
    To populate the data into this field you must have a project created to access the FM 'EXIT_SAPLRSAP_001'.
    to Create Project code goto tcode: CMOD
    1. Enter the Project name and click on create
    2. go to components select the required function module.
    EXIT_SAPLRSAP_001 for Transactional DS (RSR000
    EXIT_SAPLRSAP_002 for Master DS
    Goto SE37 and enter the Respective Function module (ex . EXIT_SAPLRSAP_001) and click on the include zxxxxx. then write the code to populate the extra fields added to the DS.
    Sample code:
    CASE i_datasource.
    WHEN '2LIS_11_VAITM'.
    loop at c_t_data into work_ar.
    do some selections, some calculations ....
    append work_ar to c_t_data. " add a new record
    modify c_t_data from wa. " change the existing record
    endloop.
    endcase.

  • Abap Code TO ENHANCE DATASOURCE with KEY FIELD OF SOURCE TABLE

    Dear Friends, Please help me to resolve this important issue at my end.
    <b>Requirement</b>:  enhance the STRUCTURAL data source which is
    based on the table VISTSU , now this table has a <b>key INTERNO</b> (Data Element : SECAINTRENO) which i want to enhance in datasource 
    SGONR = STRUCTURAL NUMBER present in extract structure of datasource
    Solution: I am not able to see any records for zzinterno enhance field in datasource rsa3 (Extractor CHECKER). Can u help me correct the ABAP code or tell me the way to pull the records for ZZINTERNO from VISTSU table.
    Thanks
    Poonam Roy
    ABAP Code
    data: l_s_REIS_STRUCTURAL_ATTR like REIS_STRUCTURAL_ATTR.
    case i_datasource.
    WHEN '0STRUCTURAL_ATTR'.
    loop at C_t_data into l_s_REIS_STRUCTURAL_ATTR.
    l_tabix = sy-tabix.
    clear  I_VISTSU .
    select single * from VISTSU  into i_VISTSU  where SG0NR = l_s_REIS_STRUCTURAL_ATTR-SGONR.
    if sy-subrc = 0.
    l_s_REIS_STRUCTURAL_ATTR-ZZINTRENO = I_VISTSU -INTRENO.
    modify C_t_data from l_s_REIS_STRUCTURAL_ATTR index l_tabix.
    endif.
    endloop.
    endcase.

    Try the below code.
    data: l_s_REIS_STRUCTURAL_ATTR like REIS_STRUCTURAL_ATTR.
    data: temp_interno like VISTSU -INTRENO.
    data:  h_tabix LIKE sy-tabix.
    case i_datasource.
    WHEN '0STRUCTURAL_ATTR'.
    loop at C_t_data into l_s_REIS_STRUCTURAL_ATTR.
    MOVE SY-TABIX TO H_TABIX.
    clear temp_interno.
    select single INTERNO from VISTSU into temp_interno where SG0NR = l_s_REIS_STRUCTURAL_ATTR-SGONR.
    if sy-subrc = 0.
    l_s_REIS_STRUCTURAL_ATTR-ZZINTRENO = temp_interno.
    endif.
    modify C_t_data from l_s_REIS_STRUCTURAL_ATTR index H_TABIX.
    ENDLOOP.
    ENDCASE.
    Regards, Siva

Maybe you are looking for

  • I Tunes not recognising ipod nano 7

    Hi, I have a new Ipod nano7.When I connect it to itunes I get a message saying the device is not recognised.I uninstalled and reinstalled itunes but still not working.I have followed all the steps Apple provide on their website. Still nothing. Anyone

  • Photoshop CS5 crashes when opening CS3 psd files?

    I just upgraded my Mac Pro 1,1 to OSX 10.6.4 and Photoshop CS5 and have installed the latest updates. When I try to open psd files created in CS3, Photoshop crashes. The files still open OK in CS3. Any fixes? Here are a few lines of the crash report.

  • Voyager 1055 USB Wireless adaptor problems

    I have just had a new broadband installation, with a HH3. I am changing over from an old 8Mb broadband on a different line which has a Netgear router on it. I have 3 similar Compaq PCs, 3 Iphone/iPods, and a Mac, and connected my work laptop OK to th

  • Migration tool Usage - Source & target portal versions

    Central note for portal migration specifies that the source portal should be in SP2 Patch 5. However the note is not clear about target portal version. The situation is that we have our current portal in EP6SP2 Patch 4 and we are evaluting Netweaver

  • Message queues and expiry *HELP*

    My problem is hopefully a simple one to overcome. Without going totally in depth, i have a Server program that creates JMS Object messages and sends them off to a message Queue. Then i have another program, a client, that recieves and processes the o