Direct Input Program to move customers

Hi,
Is anyone aware of any Direct Input Program to move customers?
Regards,
Ravi

Hi
You could use the LSMW object
0050 - Object
Method - 0000
Award Points for useful Answers

Similar Messages

  • Problem with direct input program while uploading data into database

    TABLES:  BGR00,                        " Mappensatz
             BMM00,                        " MM01/MM02  BTCI-Kopfdaten
             BMMH1,                        " MM01/MM02 Hauptdaten
             BMMH2,                        " Länderdaten (Steuern)
             BMMH3,                        " Prognosewerte
             BMMH4,                        " Verbrauchswerte
             BMMH5,                        " Kurztexte
             BMMH6,                        " Mengeneinheiten
             BMMH7,                        " Langtexte
             BMMH8.                        " Referentielle EAN's
           Satztypen
    DATA:    MAPPENSATZ  LIKE BMM00-STYPE VALUE '0',
             KOPFSATZ    LIKE BMM00-STYPE VALUE '1',
             HAUPTSATZ   LIKE BMM00-STYPE VALUE '2',
             KUN_SATZ    LIKE BMM00-STYPE VALUE 'Z',
             LANDSATZ    LIKE BMM00-STYPE VALUE '3',
             PROGSATZ    LIKE BMM00-STYPE VALUE '4',
             VERBSATZ    LIKE BMM00-STYPE VALUE '5',
             KTEXTSATZ   LIKE BMM00-STYPE VALUE '6',
             MESATZ      LIKE BMM00-STYPE VALUE '7',
             TEXTSATZ    LIKE BMM00-STYPE VALUE '8',
             EANSATZ     LIKE BMM00-STYPE VALUE '9'.
    Common Data Bereich fuer die extern aufgerufenen Routinen
           Initialstrukturen
    DATA:  BEGIN OF COMMON PART RMMMBIMY.
    DATA:    BEGIN OF I_BMM00.
               INCLUDE STRUCTURE BMM00.    " Kopfdaten
    DATA:    END OF I_BMM00.
    DATA:    BEGIN OF I_BMMH1.
               INCLUDE STRUCTURE BMMH1.    " Haupdaten
    DATA:    END OF I_BMMH1.
    DATA:    BEGIN OF I_BMMH2.
               INCLUDE STRUCTURE BMMH2.    " Länderdaten
    DATA:    END OF I_BMMH2.
    DATA:    BEGIN OF I_BMMH3.
               INCLUDE STRUCTURE BMMH3.    " Prognosewerte
    DATA:    END OF I_BMMH3.
    DATA:    BEGIN OF I_BMMH4.
               INCLUDE STRUCTURE BMMH4.    " Verbrauchswerte
    DATA:    END OF I_BMMH4.
    DATA:    BEGIN OF I_BMMH5.
               INCLUDE STRUCTURE BMMH5.    " Kurztexte
    DATA:    END OF I_BMMH5.
    DATA:    BEGIN OF I_BMMH6.
               INCLUDE STRUCTURE BMMH6.    " Mengeneinheiten
    DATA:    END OF I_BMMH6.
    DATA:    BEGIN OF I_BMMH7.
               INCLUDE STRUCTURE BMMH7.    " Textzeilen
    DATA:    END OF I_BMMH7.
    DATA:    BEGIN OF I_BMMH8.
               INCLUDE STRUCTURE BMMH8.    " Referentielle EAN's
    DATA:    END OF I_BMMH8.
    DATA:  END OF COMMON PART.
    DATA: WA LIKE TEDATA-DATA.
           Einzelfelder
    DATA:    GROUP_COUNT(6) TYPE C,    " Anzahl Mappen
             TRANS_COUNT(6) TYPE C,    " alte Definition für rmmmbim0
             SATZ_COUNT  LIKE MUEB_REST-TRANC, " Trans.zähler neu
             H_IND_COUNT LIKE MUEB_REST-D_IND, " Index welches Feld zurücks.
             SATZ2_COUNT(6) TYPE C.    " Anz. Sätze je Trans. ohne Kopfsatz
    DATA:    XEOF(1)          TYPE C,  " X=End of File erreicht
             XHAUPTSATZ_EXIST TYPE C,  " X=Hauptsatz zum Kopf exi.
             NODATA(1)        TYPE C.  " kein BI für dieses Feld
    mk/15.08.94:
    DATA:    GROUP_OPEN(1)  TYPE C.             " X=Mappe schon geöffnet
    *eject
           Konstanten
    DATA:    C_NODATA(1)    TYPE C VALUE '/'.   " Default für NODATA
    DATA:    MATNR_ERW     LIKE MARA-MATNR  VALUE '0                 '.
    DATA:    MATNR_ERW_INT LIKE MARA-MATNR.  "internal sight of '0      '
    DATA:    MATNR_LAST    LIKE MARA-MATNR.  "Material number
    mk/11.08.94 2.1H:
    If this flag is initial, the database updates will be done directly
    during background maintenance instead of using a separate update
    task. (no usage of this flag in dialogue mode!)
    DATA: DBUPDATE_VB(1) VALUE ' '.       "note 306628
    data: matsync type mat_sync. "wk/99a no update in dialog if called
    ***INCLUDE ZMUSD070.
    TABLES: MARA,                          "Material Master: General Data
            MARC,                          "Material Master: C Segment
            MARD,                          "Material Master: St Loc/Batch
            MBEW,                          "Material Valuation
            MVKE,                          "Material Master: Sales Data
            MLGN,                          "Material Data per Whse Number
            MLAN,                          "Tax Classification: Material
            T001W,                         "Plants/Branches
            TBICU.
    DATA: BEGIN OF VALUTAB OCCURS 0.
            INCLUDE STRUCTURE RSPARAMS.
    DATA: END OF VALUTAB.
    DATA: BEGIN OF VARTECH.
            INCLUDE STRUCTURE VARID.
    DATA: END OF VARTECH.
    DATA: PARMS LIKE ZXXDCONV.
    DATA: REC_COUNT      TYPE  I,
          REC_COUNT_BAD  TYPE  I,
          ZJOBID         LIKE  TBIZU-JOBID,
          ZJOBCOUNT      LIKE  TBIZU-JOBCOUNT,
          ZMATNR         LIKE  MARA-MATNR,
          ZTEXT(80)      TYPE  C.
    CONSTANTS: LIT_ZERO(18)  TYPE  C            VALUE '000000000000000000',
               LIT_CHAR      TYPE  C            VALUE '_',
               LIT_CREATE    LIKE  BMM00-TCODE  VALUE 'MM01',
               LIT_CHANGE    LIKE  BMM00-TCODE  VALUE 'MM02',
               LIT_CHECK(1)  TYPE  C            VALUE 'X'.
    DATA:  BEGIN OF INP_DATA OCCURS 0,
             MATNR(18)  TYPE C,            " Material code
             UMREN(6)   TYPE C,            " Denominator
             MEINH(3)   TYPE C,            " Alternate UOM
             UMREZ(6)   TYPE C,            " Numerator
           END OF INP_DATA.
    *eject
    SELECTION-SCREEN BEGIN OF BLOCK INOUT WITH FRAME TITLE TEXT-001.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT (13) TEXT-004.
    PARAMETERS:     P_PC        RADIOBUTTON GROUP SRC DEFAULT 'X'.
    SELECTION-SCREEN COMMENT (6) TEXT-005.
    PARAMETERS:     P_UNIX      RADIOBUTTON GROUP SRC.
    SELECTION-SCREEN COMMENT (6) TEXT-006.
    PARAMETERS:     P_DS_TYP    LIKE     ZXXDCONV-DS_TYP
                                   DEFAULT 'ASC'.
    SELECTION-SCREEN END OF LINE.
    *SELECT-OPTIONS: S_PATH      FOR      PARMS-PATH
                                  NO INTERVALS
                                  LOWER CASE.
    PARAMETERS:  P_PATH TYPE RLGRAP-FILENAME.
    PARAMETERS:     P_HDRLIN   LIKE     ZXXDCONV-HDR_LINES
                                   DEFAULT 0,
                    P_JOBNAM   LIKE     TBICU_S-JOBNAME
                                   MEMORY ID BM1,
                    P_DI_EXE    AS       CHECKBOX
                                   DEFAULT  LIT_CHECK,
                    P_MAPPE     LIKE     BGR00-GROUP
                                   DEFAULT  'MRP_UOM_LOAD'
                                   NO-DISPLAY.
    SELECTION-SCREEN END OF BLOCK INOUT.
    *eject
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_PATH.
      CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
           EXPORTING
                PROGRAM_NAME  = SYST-REPID
                DYNPRO_NUMBER = SYST-DYNNR
                FIELD_NAME    = 'P_PATH'
           CHANGING
               FILE_NAME     = S_PATH-LOW
                FILE_NAME     = P_PATH
           EXCEPTIONS
                MASK_TOO_LONG = 1
                OTHERS        = 2.
    AT SELECTION-SCREEN.
    Set up parameter record
      PARMS-UNIX      = P_UNIX.
      PARMS-PC        = P_PC.
      PARMS-DS_TYP    = P_DS_TYP.
      PARMS-JOBNAME   = P_JOBNAM.
      PARMS-MAPPE     = P_MAPPE.
      PARMS-HDR_LINES = P_HDRLIN.
    *eject
           Main Processing Routine                                       *
    START-OF-SELECTION.
    Initialization
      PERFORM 0000_HOUSEKEEPING.
    Initialize transaction data in I_BM00
    PERFORM 0500_INIT_BMM00.
    Process input files
    SORT S_PATH BY SIGN OPTION LOW.
         MOVE S_PATH-LOW TO PARMS-PATH.
          MOVE P_PATH TO PARMS-PATH.
    LOOP AT S_PATH.
       AT NEW LOW.
          CLEAR   INP_DATA.
         REFRESH INP_DATA.
    Read source data into internal table
          PERFORM 1000_GET_SOURCE_DATA TABLES INP_DATA.
    Processs each record in internal table
          ZTEXT    = TEXT-007.
          ZTEXT+13 = PARMS-DS_NAME.
          PERFORM 4000_PROGRESS_INDICATOR USING ZTEXT.
    Initialize transaction data in I_BM00
      PERFORM 0500_INIT_BMM00.
          LOOP AT INP_DATA.
    Reset tables for each record
            BMM00              = I_BMM00.
            BMMH1              = I_BMMH1.
            BMMH6              = I_BMMH6.
    Load structures with data
            MOVE-CORRESPONDING INP_DATA TO BMM00.
            PERFORM 2000_WRITE_OUTPUT USING BMM00.
            MOVE-CORRESPONDING INP_DATA TO BMMH1.
            PERFORM 2000_WRITE_OUTPUT USING BMMH1.
            MOVE-CORRESPONDING INP_DATA TO BMMH6.
            PERFORM 2000_WRITE_OUTPUT USING BMMH6.
            REC_COUNT = REC_COUNT + 1.
          ENDLOOP.
       ENDAT.
    ENDLOOP.
      IF  REC_COUNT GT 0
      AND P_DI_EXE  EQ LIT_CHECK.
        PERFORM 3000_START_DI_JOB.
      ENDIF.
    WRITE: / TEXT-008,
               REC_COUNT.
      PERFORM 9000_END_OF_JOB.
    *eject
    Include containing common routines used by direct input programs
      INCLUDE ZMUSD071.
    *eject
          FORM 0500_INIT_BMM00                                          *
          Initialize I_BMM00 with transaction code and views selected   *
    FORM 0500_INIT_BMM00.
    ***this changes done by samson**
    if not inp_data[] is initial.
    select single matnr from mara INTO ZMATNR where matnr = inp_data-matnr.
    if sy-subrc = 0.
      I_BMM00-TCODE = LIT_CHANGE.
    Basic data
      I_BMM00-XEIK1  = LIT_CHECK.
    else.
      I_BMM00-TCODE = LIT_CREATE.
    Basic data
      I_BMM00-XEIK1 = LIT_CHECK.
    endif.
    endif.
    **this changes above done by samson**
    Transaction code
    I_BMM00-TCODE = LIT_CHANGE.
    Basic data
    I_BMM00-XEIK1  = LIT_CHECK.
    ENDFORM.
    INCLUDE ZMUSD069.
    *eject
          FORM 0000_HOUSEKEEPING                                        *
          Initialization routines                                       *
    FORM 0000_HOUSEKEEPING.
      PERFORM 0010_LDS_NAME.
      PERFORM 0020_DS_NAME.
      PERFORM 0030_OPEN_FILE.
      PERFORM 0040_INIT_STRUCTS.
    ENDFORM.
    *eject
          FORM 0010_LDS_NAME                                            *
          Obtain logical file name from DI job details                  *
    FORM 0010_LDS_NAME.
    Check valid job name
      SELECT SINGLE * FROM  TBICU
                      WHERE JOBNAME EQ PARMS-JOBNAME.
      IF SY-SUBRC EQ 0.
        CALL FUNCTION 'RS_VARIANT_VALUES_TECH_DATA'
             EXPORTING
                  REPORT               = TBICU-REPNAME
                  VARIANT              = TBICU-VARIANT
             IMPORTING
                  TECHN_DATA           = VARTECH
             TABLES
                  VARIANT_VALUES       = VALUTAB
             EXCEPTIONS
                  VARIANT_NON_EXISTENT = 1
                  VARIANT_OBSOLETE     = 2
                  OTHERS               = 3.
        IF SY-SUBRC EQ 0.
          READ TABLE VALUTAB WITH KEY 'LDS_NAME'.
          MOVE VALUTAB-LOW TO PARMS-LDS_NAME.
        ELSE.
          MESSAGE I001 WITH PARMS-JOBNAME.
          MESSAGE A099.
        ENDIF.
      ELSE.
        MESSAGE I000 WITH PARMS-JOBNAME.
        MESSAGE A099.
      ENDIF.
    ENDFORM.
    *eject
          FORM 0040_INIT_STRUCTS                                        *
          Initialize structures for direct input records                *
    FORM 0040_INIT_STRUCTS.
    Start of standard SAP initialization from example program RMMMBIME
    *------- Write session record -
      CLEAR BGR00.
      BGR00-STYPE  = MAPPENSATZ.
      BGR00-GROUP  = PARMS-MAPPE.
      BGR00-NODATA = C_NODATA.
      BGR00-MANDT  = SY-MANDT.
      BGR00-USNAM  = SY-UNAME.
      BGR00-START  = BGR00-NODATA.
      BGR00-XKEEP  = BGR00-NODATA.
      PERFORM 2000_WRITE_OUTPUT USING BGR00.
    *----- Initialize structures -
      NODATA = BGR00-NODATA.
      PERFORM INIT_STRUKTUREN_ERZEUGEN(RMMMBIMI) USING NODATA.
    End of standard SAP initialization from example program RMMMBIME
    ENDFORM.
    *eject.
          FORM 3000_START_DI_JOB                                        *
          Start direct input job                                        *
    FORM 3000_START_DI_JOB.
      ZTEXT = 'Starting '(021).
      ZTEXT+9 = TBICU-JOBNAME.
      PERFORM 4000_PROGRESS_INDICATOR USING ZTEXT.
      CALL FUNCTION 'BI_START_JOB'
           EXPORTING
                JOBID                 = ' '
                JOBTEXT               = TBICU-JOBNAME
                REPNAME               = TBICU-REPNAME
                SERVER                = TBICU-EXECSERVER
                VARIANT               = TBICU-VARIANT
                NEW_JOB               = 'X'
                CONTINUE_JOB          = ' '
                START_IMMEDIATE       = 'X'
                DO_NOT_PRINT          = 'X'
                USERNAME              = SY-UNAME
           IMPORTING
                JOBID                 = ZJOBID
                JOBCOUNT              = ZJOBCOUNT
           EXCEPTIONS
                JOB_OPEN_FAILED       = 1
                JOB_CLOSE_FAILED      = 2
                JOB_SUBMIT_FAILED     = 3
                WRONG_PARAMETERS      = 4
                JOB_DOES_NOT_EXIST    = 5
                WRONG_STARTTIME_GIVEN = 6
                JOB_NOT_RELEASED      = 7
                WRONG_VARIANT         = 8
                NO_AUTHORITY          = 9
                DIALOG_CANCELLED      = 10
                JOB_ALREADY_EXISTS    = 11
                PERIODIC_NOT_ALLOWED  = 12
                ERROR_NUMBER_GET_NEXT = 13
                OTHERS                = 14.
      IF SY-SUBRC EQ 0.
        WRITE: / 'Direct input job'(022), TBICU-JOBNAME, 'started'.
      ELSE.
        WRITE: / 'Direct input failed with return code'(023), SY-SUBRC.
      ENDIF.
    FORM 0020_DS_NAME.
      CALL FUNCTION 'FILE_GET_NAME'
           EXPORTING
                CLIENT           = SY-MANDT
                LOGICAL_FILENAME = PARMS-LDS_NAME
                OPERATING_SYSTEM = SY-OPSYS
           IMPORTING
                FILE_NAME        = PARMS-DS_NAME
           EXCEPTIONS
                FILE_NOT_FOUND   = 1
                OTHERS           = 2.
      IF SY-SUBRC NE 0.
        MESSAGE E002 WITH PARMS-LDS_NAME.
        MESSAGE A099.
      ENDIF.
    ENDFORM.
    *eject
          FORM 0030_OPEN_FILE                                           *
          Open physical file for output                                 *
    FORM 0030_OPEN_FILE.
    OPEN DATASET PARMS-DS_NAME FOR OUTPUT IN TEXT MODE. "thg191105
      OPEN DATASET PARMS-DS_NAME FOR OUTPUT IN TEXT MODE
                                     encoding default. "thg191105
      IF SY-SUBRC NE 0.
        MESSAGE E003 WITH PARMS-DS_NAME.
        MESSAGE A099.
      ENDIF.
    ENDFORM.
    *eject
          FORM 1000_GET_SOURCE_DATA                                     *
          Read source data into internal table                          *
    -->  INP_DATA   " Name of internal table passed as parameter       *
    FORM 1000_GET_SOURCE_DATA TABLES INP_DATA.
      CALL FUNCTION 'Z_FILE_UPLOAD'
           EXPORTING
                UNIX                = PARMS-UNIX
                PC                  = PARMS-PC
                FILETYPE            = PARMS-DS_TYP
                FILENAME            = PARMS-PATH
                HDR_LINES           = PARMS-HDR_LINES
           TABLES
                DATA_TAB            = INP_DATA
           EXCEPTIONS
                CONVERSION_ERROR    = 1
                FILE_OPEN_ERROR     = 2
                FILE_READ_ERROR     = 3
                INVALID_TABLE_WIDTH = 4
                INVALID_TYPE        = 5
                NO_BATCH            = 6
                UNKNOWN_ERROR       = 7
                INVALID_SOURCE      = 8
                OTHERS              = 9.
    ENDFORM.
    *eject
          FORM 2000_WRITE_OUTPUT                                        *
          Write record in standard SAP structure to UNIX file           *
    -->  I_STRUCT   " Name of record passed as parameter               *
    *FORM 2000_WRITE_OUTPUT USING I_STRUCT."SRY28NOV05
    FORM 2000_WRITE_OUTPUT USING I_STRUCT TYPE ANY.      "SRY28NOV05
       TRANSFER I_STRUCT TO PARMS-DS_NAME.
      IF SY-SUBRC NE 0.
        MESSAGE E004 WITH PARMS-DS_NAME.
        MESSAGE A099.
      ENDIF.
    ENDFORM.
    *eject
    *&      Form  2100_WS_DOWNLOAD
          text                                                           *
    -->  p1        text
    <--  p2        text
    FORM 2100_WS_DOWNLOAD TABLES INP_DATA.
    DATA: FILENAME LIKE RLGRAP-FILENAME.   "SRY28NOV05
      DATA: W_FILENAME TYPE STRING.             "SRY28NOV05
      DATA: W_FTYP(10) TYPE C VALUE 'DAT'.      "SRY28NOV05
    MOVE PARMS-DS_NAME TO FILENAME.       "SRY28NOV05
      MOVE PARMS-DS_NAME TO W_FILENAME.      "SRY28NOV05
    *BEGIN OF BLOCK COMMENT BY SRY28NOV05
    CALL FUNCTION 'WS_DOWNLOAD'
          EXPORTING
            BIN_FILESIZE        = ' '
            CODEPAGE            = ' '
               FILENAME            = FILENAME
               FILETYPE            = 'DAT'
            MODE                = ' '
            WK1_N_FORMAT        = ' '
            WK1_N_SIZE          = ' '
            WK1_T_FORMAT        = ' '
            WK1_T_SIZE          = ' '
            COL_SELECT          = ' '
            COL_SELECTMASK      = ' '
       importing
            filelength          =
          TABLES
               DATA_TAB            = INP_DATA
            FIELDNAMES          =
          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.
    *END OF BLOCK COMMENT BY SRY28NOV05
    *BEGIN OF BLOCK ADDED BY SRY28NOV05
      CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
          FILENAME                        = W_FILENAME
          FILETYPE                        = W_FTYP
        TABLES
          DATA_TAB                        = INP_DATA
       EXCEPTIONS
         FILE_WRITE_ERROR                = 1
         NO_BATCH                        = 2
         GUI_REFUSE_FILETRANSFER         = 3
         INVALID_TYPE                    = 4
         NO_AUTHORITY                    = 5
         UNKNOWN_ERROR                   = 6
         HEADER_NOT_ALLOWED              = 7
         SEPARATOR_NOT_ALLOWED           = 8
         FILESIZE_NOT_ALLOWED            = 9
         HEADER_TOO_LONG                 = 10
         DP_ERROR_CREATE                 = 11
         DP_ERROR_SEND                   = 12
         DP_ERROR_WRITE                  = 13
         UNKNOWN_DP_ERROR                = 14
         ACCESS_DENIED                   = 15
         DP_OUT_OF_MEMORY                = 16
         DISK_FULL                       = 17
         DP_TIMEOUT                      = 18
         FILE_NOT_FOUND                  = 19
         DATAPROVIDER_EXCEPTION          = 20
         CONTROL_FLUSH_ERROR             = 21
         OTHERS                          = 22.
      IF SY-SUBRC NE 0.
         MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
               WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    *END OF BLOCK ADDED BY SRY28NOV05
    ENDFORM.                               " 2100_WS_DOWNLOAD
    *eject
          FORM 4000_PROGRESS_INDICATOR                                  *
          Write progress text to status bar                             *
    -->  TEXT   " Text passed as parameter                             *
    FORM 4000_PROGRESS_INDICATOR USING TEXT.
      CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
           EXPORTING
                PERCENTAGE = 0
                TEXT       = TEXT
           EXCEPTIONS
                OTHERS     = 1.
    ENDFORM.
    *eject.
          FORM 9000_END_OF_JOB                                          *
          Close files on UNIX                                           *
    FORM 9000_END_OF_JOB.
      CLOSE DATASET PARMS-DS_NAME.
    ENDFORM.
    FORM 1000_GET_SOURCE_DATA TABLES INP_DATA.
      CALL FUNCTION 'Z_FILE_UPLOAD'
           EXPORTING
                UNIX                = PARMS-UNIX
                PC                  = PARMS-PC
                FILETYPE            = PARMS-DS_TYP
                FILENAME            = PARMS-PATH
                HDR_LINES           = PARMS-HDR_LINES
           TABLES
                DATA_TAB            = INP_DATA
           EXCEPTIONS
                CONVERSION_ERROR    = 1
                FILE_OPEN_ERROR     = 2
                FILE_READ_ERROR     = 3
                INVALID_TABLE_WIDTH = 4
                INVALID_TYPE        = 5
                NO_BATCH            = 6
                UNKNOWN_ERROR       = 7
                INVALID_SOURCE      = 8
                OTHERS              = 9.
    ENDFORM.
    *eject
          FORM 2000_WRITE_OUTPUT                                        *
          Write record in standard SAP structure to UNIX file           *
    -->  I_STRUCT   " Name of record passed as parameter               *
    *FORM 2000_WRITE_OUTPUT USING I_STRUCT."SRY28NOV05
    FORM 2000_WRITE_OUTPUT USING I_STRUCT TYPE ANY.      "SRY28NOV05
       TRANSFER I_STRUCT TO PARMS-DS_NAME.
      IF SY-SUBRC NE 0.
        MESSAGE E004 WITH PARMS-DS_NAME.
        MESSAGE A099.
      ENDIF.
    ENDFORM.
    *eject
    *&      Form  2100_WS_DOWNLOAD
          text                                                           *
    -->  p1        text
    <--  p2        text
    FORM 2100_WS_DOWNLOAD TABLES INP_DATA.

    Hi,
    Thnaks for your reply, This is my requirement.
    Here my problem is i am trying to upload the data from flatfile which contain materil number, denominator, Actual UOM, Nominator field values.
    Which is the data i need to upload into MM02 and MM01, if material number is new then it has to create the material, if material is already existing it has to update the UOM values.
    here i am getting data into my internal table INP_DATA, from that i am trying to upload the data to database by using job name MRP_MATERIAL_MASTER_DATA_UPLOAD with direct input program RMDATIND.
    when i execute my program i am getting success message all the records writtin from flatfile to application server. and job started message.
    then if i go into sm37 screen there i execute the job it is also giving active message. if i refresh it it is showing job completed message.
    then i look at job log status. there i found that for existing material it is expecting material type, for new material it is giving some gravity error.
    So could u help me in this it will be gr8.
    Thanks & Regards,
    RamNV

  • LSMW or ABAP Program:- I need BAPI function module or Direct input program

    hi experts,
    I have to develop the program which uploads the transportation pricing data for freight cost management.
    the transcation code is XK15 for the application A.
    There is a program called RV14BTCI which will uploads for the application V or M not for A.
    So i can use lsmw or direct input program in both lsmw and abap program so plz help me if there is any BAPI function module or Direct input program for Application A.
    thank you,
    waiting for u r reply.
    Edited by: SANTOSH MARUPALLY on Jan 22, 2008 6:27 AM

    Hi Santosh
    Am not really sure if RV14BTCI can not be used for other applications apart from V and M.
    You can try using BAPI: BAPI_PRICES_CONDITIONS. Over the forum you can find few example coding.
    Regards
    Eswar

  • Problem in getting data into database with standard direct input program

    HI All,
    I am having problem which is not updating the records in MM01 or MM02 with standard direct input program. i have data in internal table. from that table i am trying to upload into database by using background job MRP_MATERIAL_MASTER_DATA_LOAD.
    when i execute my program it is showing message job is started. then i go into sm37 and seethe job status by executing. there also i am seeing job completed succesfully.
    but if i go to mm03 and find the materials are updated or created there i couldn't find the material numbers which are from internal table.
    So if ny one help me it wil be great.
    Thanks in Advance
    Venkat N

    Hi Anil,
    Thanks for your answer, but i am facing problem is i have material no and denominator and Actual UOM and nominator field values in the flat file.....
    by using RMDATIND direct input program with MRP_MATERIAL_UPLOAD as job name for background job while uploading data into database.
    here i am not getting data in to database, but when i execute the job in sm37 it is showing that message job processing successfully completed...this is my status..
    if u can help me in this it will be gr8ful..
    Thanks,
    Venkat N

  • Direct Input Programs in SAP

    Hi,
    Can anybody provide me the list of Direct Input programs available in SAP.
    Thanks,
    Sunil.

    hI,
    Direct Input:
    A recent technique to input data safely. An alternative to batch input.
    With direct input, the SAP function modules execute the consistency checks. However with batch input, these consistency checks are executed with help of the screens. This means that direct input has considerable performance advantages. But there are a few programs for direct input, you can use them if it accomplishes your goal. Direct Input programs work like that they update database tables directly. As you know that it is forbidden to update SAP database tables directly, since consistency and security should be considered. Exceptions are these direct input programs. So you are not able to write custom ABAP direct input programs. But of course you can write ABAP programs to update custom database tables (Z tables), if you are sure all about consistency.
    SAP has created direct input programs because SAP wanted to enhance the batch input procedure, since batch input is slower. SAP offers the direct input technique, especially for transferring large amount of data. In contrast to batch input, this technique does not create sessions, but stores, updates, inserts data directly. To enter the data into the corresponding database tables directly, the system calls a number of function modules that execute any necessary checks. In case of errors, the direct input technique provides a restart mechanism. However, to able to activate the restart mechanism, direct input programs must be executed in the background only. To maintain and start these programs, use program RBMVSHOW or transaction BMV0.
    Examples for direct input programs are:
    RFBIBL00 - FI
    RMDATIND - MM
    RVAFSS00 - SD
    RAALTD11 - AM
    RKEVEXTO - CO-PA
    Regards
    Kiran Sure

  • Does SAP direct input programs have authorization checks built-in?

    Can anyone advise if the SAP direct input programs eg. RFBIBL00, RMDATIND,      RCCLBI03,  RM60IN00,   RVINVB10 etc. have authorization checking features?
    In transaction BMV0,  there is a value for User Name.  If the user executes the direct input job from here, but uses a different User Name in the job definition in BMV0, does that mean that the authorization check is done against the User Name maintained instead?
    Kindly advise asap, thanks.

    Hi Li,
      This is what the SAP Doucmentation says about the USer name that is maintained in BMV0 transaction.
    <i><b>" User name in user master record                                                                               
    Background processing takes place under this user name. This person   
         needs to have the application-specific authorizations necessary for   
         running the direct input job (for example, all material master        
         authorizations).                                                                               
    If you do not enter a name, the job will run under the user name of the
         person scheduling it.                                                  "</b></i>
    Regards,
    Ravi

  • Error while running the RMDATIND direct input Program

    Hi experts,
    I am writing a program to load a material for the BASIC VIEW and PURCHASING VIEW and SALES VIEW and PLANT STORAGE VIEW and WARE HOUSE MANAGEMENT VIEW.
    While running the RMDATIND program with the file i am getting the error " Specify the relevant unit of measure ".
    Can any one help.
    Waiting for your replay.
    Thanks,
    Kruthik.

    Check UOm, Alternate UoM and EAN Number fields
    Regards
    Vinod

  • LSMW Direct Input Custom Program

    Hi All,
    I have been trying to set up a custom (Z Program) for direct input method for LSMW. So far I have dicovered that it can be achieved by modifing SXDA0-3 tables.
    Has anyone achieved this successfully? Any example (even the simplest one) or step by step help would be highly appreciated.
    Regards,
    ~Mark

    Yes, it does appear that this table contains the data which gives the structures names of the structures used in direct input programs. 
    Documentation for LSMW is limited, but here are some links.
    http://www.erpgenie.com/sap/saptech/lsmw.htm
    http://www.sap-img.com/sap-data-migration.htm
    http://www.ficoexpertonline.com/downloads/0703.doc
    http://help.sap.com/saphelp_nw2004s/helpdata/en/ad/2d54a41d7011d2b42e006094b944c8/frameset.htm
    REgards,
    RIch Heilman
    Message was edited by:
            Rich Heilman

  • Re: direct input method

    Hi,
       Is there any standard direct input programs for material master upload.
    rgds
    p.kp

    Hi
    There is a standard Programs for Different Modules.
    But you need to populate the Data, and send the data to the Direct Input Program in a specific format , format in the sense you need to populate the nodata for fields which you don't want to update.
    and submit to the std direct input program.
    check the code below..
    *& Report  Z__DIRECT__MAT___CREAT                                      *
    REPORT  Z__DIRECT__MAT___CREAT                  .
    INCLUDE Z_INCLUDE_MAT_CREAT.
    *  SELECTION SCREEN
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-002.
    PARAMETERS:P_FILE LIKE RLGRAP-FILENAME OBLIGATORY.
    SELECTION-SCREEN END OF BLOCK B1 .
    * AT SELECTION SCREEN
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE.
      CALL FUNCTION 'F4_FILENAME'
        EXPORTING
          PROGRAM_NAME  = SYST-CPROG
          DYNPRO_NUMBER = SYST-DYNNR
          FIELD_NAME    = 'P_FILE'
        IMPORTING
          FILE_NAME     = P_FILE.
    *START-OF-SELECTION
    START-OF-SELECTION.
    *Perform to upload the data from Presentation Server
      V_FILE = P_FILE.
      PERFORM UPLOAD_DATA.
    *Transfer the Data to the structure BGR00 BMMH1 BMM00
      PERFORM CONVERT_0000.                                     " BGR00
      PERFORM POPULATE_DATA CHANGING BMM00.
      PERFORM POPULATE_DATA CHANGING BMMH1.
    **Looping the flat file data and updating the structures BMM00 & BMMH1
      LOOP AT MATERIAL_MASTER.
    *Writing the Data to the Application Server in a proper Format
        OPEN DATASET C_ZTEST FOR APPENDING IN  TEXT MODE ENCODING
        DEFAULT.
    *Transfer the Data to the structure BMM00
        PERFORM CONVERT_0002.                                   " BMM00
    *Transfer the Data to the structure BMMh1
        PERFORM CONVERT_0003.                                   " BMMH1
    **Closing the dataset after transfering the data
        CLOSE DATASET  C_ZTEST.
      ENDLOOP.     "Endloop of MATERIAL_MASTER
    *END-OF-SELECTION
    END-OF-SELECTION.
    **Calling the Direct Input Program to Create the material
      SUBMIT RMDATIND WITH %%%_R_P = C_X
                        WITH %%%_PHY = C_ZTEST
                        WITH SPERR = C_N.
    include for the above..
    *&  Include           Z_INCLUDE_MAT_CREAT                              *
    **Tables Used To Create the Material
    TABLES:
      BGR00,
      BMM00,
      BMMH1.
    DATA:C_ZTEST(60) type c,
         C_X TYPE C,
         C_N TYPE C,
         V_file type string.
    C_ZTEST = 'Ztest.lsmw.conv'(001).
    C_X = 'X'(003).
    C_N = 'N'(004).
    **FILED SYMBOLS
    FIELD-SYMBOLS: <F> .
    **Structure to Hold the Flat File
    data:
      begin of LSMW_MATERIAL_MASTER,
        MATNR(018) type C,  "Material number
        MTART(004) type C,  "Material type
        MBRSH(001) type C,  "Industry sector
        WERKS(004) type C,  "Plant
        MAKTX(040) type C,  "Material description
        DISMM(002) type C,  "Extra Field Added In the Program as it is required
        MEINS(003) type C,  "Base unit of measure
        MATKL(009) type C,  "Material group
        SPART(002) type C,  "Division
        LABOR(003) type C,  "Lab/office
        PRDHA(018) type C,  "Product hierarchy
        MSTAE(002) type C,  "X-plant matl status
        MTPOS_MARA(004) type C,  "Gen item cat group
        BRGEW(017) type C,  "Gross weight
        GEWEI(003) type C,  "Weight unit
        NTGEW(017) type C,  "Net weight
        GROES(032) type C,  "Size/Dimensions
        MAGRV(004) type C,  "Matl grp pack matls
        BISMT(018) type C,  "Old material number
        WRKST(048) type C,  "Basic material
        PROFL(003) type C,  "DG indicator profile
        KZUMW(001) type C,  "Environmentally rlvt
        BSTME(003) type C,  "Order unit
        VABME(001) type C,
        EKGRP(003) type C,  "Purchasing group
        XCHPF(001) type C,  "Batch management
        EKWSL(004) type C,  "Purchasing key value
        WEBAZ(003) type C,  "GR processing time
        MFRPN(040) type C,  "Manufacturer part number
        MFRNR(010) type C,  "Manufacturer number
        VPRSV(001) type C,  "Price control indicator
        STPRS(015) type C,  "Standard price
        BWPRH(014) type C,  "Commercial price1
      end of LSMW_MATERIAL_MASTER.
    **InternalTable to HOld the Flat File Data
    DATA:
      BEGIN OF MATERIAL_MASTER OCCURS 0.
            INCLUDE STRUCTURE LSMW_MATERIAL_MASTER.
    DATA:
      END OF MATERIAL_MASTER.
    *&      Form  upload_data From Presentation Server
    FORM UPLOAD_DATA.
      CALL FUNCTION 'GUI_UPLOAD'
        EXPORTING
          FILENAME                      = V_FILE
         FILETYPE                      = 'ASC'
         HAS_FIELD_SEPARATOR           = 'X'
    *     HEADER_LENGTH                 = 0
    *     READ_BY_LINE                  = 'X'
    *     DAT_MODE                      = ' '
    *     CODEPAGE                      = ' '
    *     IGNORE_CERR                   = ABAP_TRUE
    *     REPLACEMENT                   = '#'
    *   IMPORTING
    *     FILELENGTH                    =
    *     HEADER                        =
        TABLES
          DATA_TAB                      = MATERIAL_MASTER
       EXCEPTIONS
         FILE_OPEN_ERROR               = 1
         FILE_READ_ERROR               = 2
         NO_BATCH                      = 3
         GUI_REFUSE_FILETRANSFER       = 4
         INVALID_TYPE                  = 5
         NO_AUTHORITY                  = 6
         UNKNOWN_ERROR                 = 7
         BAD_DATA_FORMAT               = 8
         HEADER_NOT_ALLOWED            = 9
         SEPARATOR_NOT_ALLOWED         = 10
         HEADER_TOO_LONG               = 11
         UNKNOWN_DP_ERROR              = 12
         ACCESS_DENIED                 = 13
         DP_OUT_OF_MEMORY              = 14
         DISK_FULL                     = 15
         DP_TIMEOUT                    = 16
         OTHERS                        = 17
      IF SY-SUBRC = 0.
        DELETE MATERIAL_MASTER INDEX 1.
      ENDIF.
    ENDFORM.                    "upload_data
    *&    Updating the BGR00 Structure
    FORM CONVERT_0000.                                          " BGR00
    **Opening the Data Set to write the data to Application Server
      OPEN DATASET C_ZTEST FOR OUTPUT IN  TEXT MODE ENCODING DEFAULT
    MOVE: '0' TO BGR00-STYPE,
             'ZTEST' TO BGR00-GROUP,
             SY-MANDT TO BGR00-MANDT,
             SY-UNAME TO BGR00-USNAM,
             'X' TO BGR00-XKEEP,
             '/' TO BGR00-NODATA.
    *Transefering the Data To the Application Server File
      TRANSFER BGR00 TO C_ZTEST.
    *Closing the Dataset after Transfer
      CLOSE DATASET C_ZTEST.
    ENDFORM.                    "convert_0001
    *&     Updating BMM00 Structure
    FORM CONVERT_0002.                                          " BMM00
    * --- BMM00-STYPE
      BMM00-STYPE = '1'.
    * --- BMM00-TCODE
      BMM00-TCODE = 'MM01'.
    * --- BMM00-MATNR
      IF NOT MATERIAL_MASTER-MATNR IS INITIAL.
        BMM00-MATNR = MATERIAL_MASTER-MATNR.
      ELSE.
        BMM00-MATNR = '/'.
      ENDIF.
    * --- BMM00-MBRSH
      IF NOT MATERIAL_MASTER-MBRSH IS INITIAL.
        BMM00-MBRSH = MATERIAL_MASTER-MBRSH.
      ELSE.
        BMM00-MBRSH = '/'.
      ENDIF.
    * --- BMM00-MTART
      IF NOT MATERIAL_MASTER-MTART IS INITIAL.
        BMM00-MTART = MATERIAL_MASTER-MTART.
      ELSE.
        BMM00-MTART = '/'.
      ENDIF.
    * --- BMM00-WERKS
      IF NOT MATERIAL_MASTER-WERKS IS INITIAL.
        BMM00-WERKS = MATERIAL_MASTER-WERKS.
      ELSE.
        BMM00-WERKS = '/'.
      ENDIF.
      BMM00-XEIB1 = 'X'.  " BMM00-xeib1 = '/'.
      BMM00-XEIE1 = 'X'.  " BMM00-xeie1 = '/'.
      BMM00-XEIK1 = 'X'.  " BMM00-xeik1 = '/'.
    **Transfer the data to the Application Server File
      TRANSFER BMM00 TO C_ZTEST.
    ENDFORM.                    "convert_0002
    *&      UPdating BMMH1 Structure
    FORM CONVERT_0003.                                          " BMMH1
    * --- BMMH1-STYPE
      BMMH1-STYPE = '2'.
    * --- BMMH1-MEINS
      IF NOT MATERIAL_MASTER-MEINS IS INITIAL.
        BMMH1-MEINS = MATERIAL_MASTER-MEINS.
      ELSE.
        BMMH1-MEINS = '/'.
      ENDIF.
    * --- BMMH1-MAKTX
      IF NOT MATERIAL_MASTER-MAKTX IS INITIAL.
        BMMH1-MAKTX = MATERIAL_MASTER-MAKTX.
      ELSE.
        BMMH1-MAKTX = '/'.
      ENDIF.
    * --- BMMH1-MATKL
      IF NOT MATERIAL_MASTER-MATKL IS INITIAL.
        BMMH1-MATKL = MATERIAL_MASTER-MATKL.
      ELSE.
        BMMH1-MATKL = '/'.
      ENDIF.
    * --- BMMH1-BISMT
      IF NOT MATERIAL_MASTER-BISMT IS INITIAL.
        BMMH1-BISMT = MATERIAL_MASTER-BISMT.
      ELSE.
        BMMH1-BISMT = '/'.
      ENDIF.
    * --- BMMH1-LABOR
      IF NOT MATERIAL_MASTER-LABOR IS INITIAL.
        BMMH1-LABOR = MATERIAL_MASTER-LABOR.
      ELSE.
        BMMH1-LABOR = '/'.
      ENDIF.
    * --- BMMH1-WRKST
      IF NOT MATERIAL_MASTER-WRKST IS INITIAL.
        BMMH1-WRKST = MATERIAL_MASTER-WRKST.
      ELSE.
        BMMH1-WRKST = '/'.
      ENDIF.
    * --- BMMH1-BRGEW
      IF NOT MATERIAL_MASTER-BRGEW IS INITIAL.
        BMMH1-BRGEW = MATERIAL_MASTER-BRGEW.
      ELSE.
        BMMH1-BRGEW = '/'.
      ENDIF.
    * --- BMMH1-NTGEW
      IF NOT MATERIAL_MASTER-NTGEW IS INITIAL.
        BMMH1-NTGEW = MATERIAL_MASTER-NTGEW.
      ELSE.
        BMMH1-NTGEW = '/'.
      ENDIF.
    * --- BMMH1-GEWEI
      IF NOT MATERIAL_MASTER-GEWEI IS INITIAL.
        BMMH1-GEWEI = MATERIAL_MASTER-GEWEI.
      ELSE.
        BMMH1-GEWEI = '/'.
      ENDIF.
    * --- BMMH1-GROES
      IF NOT MATERIAL_MASTER-GROES IS INITIAL.
        BMMH1-GROES = MATERIAL_MASTER-GROES.
      ELSE.
        BMMH1-GROES = '/'.
      ENDIF.
    * --- BMMH1-SPART
      IF NOT MATERIAL_MASTER-SPART IS INITIAL.
        BMMH1-SPART = MATERIAL_MASTER-SPART.
      ELSE.
        BMMH1-SPART = '/'.
      ENDIF.
    * --- BMMH1-BSTME
      IF NOT MATERIAL_MASTER-BSTME IS INITIAL.
        BMMH1-BSTME = MATERIAL_MASTER-BSTME.
      ELSE.
        BMMH1-BSTME = '/'.
      ENDIF.
    * --- BMMH1-EKWSL
      IF NOT MATERIAL_MASTER-EKWSL IS INITIAL.
        BMMH1-EKWSL = MATERIAL_MASTER-EKWSL.
      ELSE.
        BMMH1-EKWSL = '/'.
      ENDIF.
    * --- BMMH1-EKGRP
      IF NOT MATERIAL_MASTER-EKGRP IS INITIAL.
        BMMH1-EKGRP = MATERIAL_MASTER-EKGRP.
      ELSE.
        BMMH1-EKGRP = '/'.
      ENDIF.
    * --- BMMH1-XCHPF
      IF NOT MATERIAL_MASTER-XCHPF IS INITIAL.
        BMMH1-XCHPF = MATERIAL_MASTER-XCHPF.
      ELSE.
        BMMH1-XCHPF = '/'.
      ENDIF.
    * --- BMMH1-WEBAZ
      IF NOT MATERIAL_MASTER-WEBAZ IS INITIAL.
        BMMH1-WEBAZ = MATERIAL_MASTER-WEBAZ.
      ELSE.
        BMMH1-WEBAZ = '/'.
      ENDIF.
      IF NOT MATERIAL_MASTER-DISMM IS INITIAL.
        BMMH1-DISMM = MATERIAL_MASTER-DISMM.
      ELSE.
        BMMH1-DISMM = '/'.
      ENDIF.
    * --- BMMH1-VPRSV
      IF NOT MATERIAL_MASTER-VPRSV IS INITIAL.
        BMMH1-VPRSV = MATERIAL_MASTER-VPRSV.
      ELSE.
        BMMH1-VPRSV = '/'.
      ENDIF.
      BMMH1-VERPR = '/'.
    * --- BMMH1-STPRS
      IF NOT MATERIAL_MASTER-STPRS IS INITIAL.
        BMMH1-STPRS = MATERIAL_MASTER-STPRS.
      ELSE.
        BMMH1-STPRS = '/'.
      ENDIF.
    * --- BMMH1-BWPRH
      IF NOT MATERIAL_MASTER-BWPRH IS INITIAL.
        BMMH1-BWPRH = MATERIAL_MASTER-BWPRH.
      ELSE.
        BMMH1-BWPRH = '/'.
      ENDIF.
    * --- BMMH1-PRDHA
      IF NOT MATERIAL_MASTER-PRDHA IS INITIAL.
        BMMH1-PRDHA = MATERIAL_MASTER-PRDHA.
      ELSE.
        BMMH1-PRDHA = '/'.
      ENDIF.
    * --- BMMH1-VABME
      IF NOT MATERIAL_MASTER-VABME IS INITIAL.
        BMMH1-VABME = MATERIAL_MASTER-VABME.
      ELSE.
        BMMH1-VABME = '/'.
      ENDIF.
    * --- BMMH1-MAGRV
      IF NOT MATERIAL_MASTER-MAGRV IS INITIAL.
        BMMH1-MAGRV = MATERIAL_MASTER-MAGRV.
      ELSE.
        BMMH1-MAGRV = '/'.
      ENDIF.
    * --- BMMH1-KZUMW
      IF NOT MATERIAL_MASTER-KZUMW IS INITIAL.
        BMMH1-KZUMW = MATERIAL_MASTER-KZUMW.
      ELSE.
        BMMH1-KZUMW = '/'.
      ENDIF.
    * --- BMMH1-MFRNR
      IF NOT MATERIAL_MASTER-MFRNR IS INITIAL.
        BMMH1-MFRNR = MATERIAL_MASTER-MFRNR.
      ELSE.
        BMMH1-MFRNR = '/'.
      ENDIF.
    * --- BMMH1-MFRPN
      IF NOT MATERIAL_MASTER-MFRPN IS INITIAL.
        BMMH1-MFRPN = MATERIAL_MASTER-MFRPN.
      ELSE.
        BMMH1-MFRPN = '/'.
      ENDIF.
      BMMH1-MPROF = '/'.
    * --- BMMH1-MSTAE
      IF NOT MATERIAL_MASTER-MSTAE IS INITIAL.
        BMMH1-MSTAE = MATERIAL_MASTER-MSTAE.
      ELSE.
        BMMH1-MSTAE = '/'.
      ENDIF.
    * --- BMMH1-PROFL
      IF NOT MATERIAL_MASTER-PROFL IS INITIAL.
        BMMH1-PROFL = MATERIAL_MASTER-PROFL.
      ELSE.
        BMMH1-PROFL = '/'.
      ENDIF.
    * --- BMMH1-MTPOS_MARA
      IF NOT MATERIAL_MASTER-MTPOS_MARA IS INITIAL.
        BMMH1-MTPOS_MARA = MATERIAL_MASTER-MTPOS_MARA.
      ELSE.
        BMMH1-MTPOS_MARA = '/'.
      ENDIF.
    **Transfer the Data to Application Server File
    TRANSFER BMMH1 TO C_ZTEST.
    ENDFORM.                    "convert_0003
    *&      Form  POPULATE_DATA
    *       text
    *      <--P_BLF text
    FORM POPULATE_DATA  CHANGING P_BLF.
      DATA: L_NUM TYPE I.
      DO.
        L_NUM = L_NUM + 1.
        ASSIGN COMPONENT L_NUM OF STRUCTURE P_BLF TO <F>.
        IF SY-SUBRC <> 0.
          EXIT.
        ENDIF.
        MOVE BGR00-NODATA TO <F>.
      ENDDO.
    ENDFORM.                    " POPULATE_DATA

  • Upload sales text for material master using LSMW direct input method

    Hello Experts,
    I was trying to upload sales text for a material master using LSMW direct input method.
    I followed the following steps for the same
    Tab dlimited Text file format
    MATNR           LONGTEXT                                                     LINE       
    MATERIAL1    LONGTEXT FOR MATERIAL MATERIAL1       1
    Step1 -> Maintain object attributes
    Object -> 0001
    Method-> 0001
    Program name -> /SAPDMC/SAP_LSMW_IMPORT_TEXTS
    Program type -> D
    Step2 -> Maintain Source Structure
    Source structure -> LONG_TEXT            Source structure for long text
    Step 3-> Maintain souce file
    Source Fields
    ZLONG_TEXT             Source structure for long text
                           MATNR                         C(018)    MATNR
                           LTEXT                          C(132)    LTEXT
    Step 4-> Maintain structure relationship
    Structure Relations
    /SAPDMC/LTXTH Long Texts: Header                                           <<<< ZLONG_TEXT Source structure for long text
                  Select Target Structure /SAPDMC/LTXTH .
    /SAPDMC/LTXTL Long Texts: Row                                              <<<< ZLONG_TEXT Source structure for long text
                 Select Target Structure /SAPDMC/LTXTL .
    Step 5-> Maintain Field mapping and conversion rules
    Here i have assigned constan rules to couple of them like
    /SAPDMC/LTXTH                  Long Texts: Header
    Fields
       OBJECT                Texts: Application Object
                                    Rule :   Constant
                                    Code:    /SAPDMC/LTXTH-OBJECT = 'MVKE'.
       NAME                  Name
                                    Source:  ZLONG_TEXT-MATNR (MATNR)
                                    Rule :   Transfer (MOVE)
                                    Code:    /SAPDMC/LTXTH-NAME = ZLONG_TEXT-MATNR.
       ID                         Text ID
                                    Rule :   Constant
                                    Code:    /SAPDMC/LTXTH-ID = '0001'.
       SPRAS                 Language Key
                                    Rule :   Constant
                                    Code:    /SAPDMC/LTXTH-SPRAS = 'E'.
    /SAPDMC/LTXTL                  Long Texts: Row
      Fields
        TEXTFORMAT     Tag column
                                    Rule :   Constant
                                    Code:    /SAPDMC/LTXTL-TEXTFORMAT = '/'.
        TEXTLINE             Text Line
                                    Source:  ZLONG_TEXT-LTEXT (LTEXT)
                                    Rule :   Transfer (MOVE)
                                    Code:    /SAPDMC/LTXTL-TEXTLINE = ZLONG_TEXT-LTEXT.
    Step6 -> Specify file
    Legacy Data          On the PC (Frontend)
                 Data                           D:\Sales_Longtext.txt
    Step7 -> Assign File
    ZLONG_TEXT Source structure for long text
                  Data D:\Sales_Longtext.txt
    Step8 -> Read data
    Output result
    Source Structure             Read      Written        Not Written
    ZLONG_TEXT              1                1              0
    Transactions Read:            1
    Records Read:                   1
    Transactions Written:         1
    Records Written:                 1
    Step 8 -> Display read data
    Field Name                    Field Text Field Value
    MATNR                          MATNR      MATERIA1
    LTEXT                            LTEXT      SALES TEXT FOR Material MATERIAL1
    Step 9 -> Convert data
    File Read:          ZNRD_PRJ1_ZNRD_SUBPRJ2_ZNRD_LTEXT.lsmw.read
    File Written:       ZNRD_PRJ1_ZNRD_SUBPRJ2_ZNRD_LTEXT.lsmw.conv
    Transactions Read:                 1
    Records Read:                        1
    Transactions Written:              1
    Records Written:                     2
    Step 10 -> Display converted data
    1 /SAPDMC/LTXTH                   1MVKE      MATERIAL1                                                                   0001E
    2 /SAPDMC/LTXTL                   2/ SALES TEXT FOR Material MATERIAL1
    Step 11 -> Start direct input program
    Output result for the same
    Legacy System Migration Workbench
    Project:                              ZNRD_PRJ1       ORH
    Subproject:                        ZNRD_SUBPRJ2    Upload long text
    Object:                               ZNRD_LTEXT      Long text tru direct input
    File :                                   ZNRD_PRJ1_ZNRD_SUBPRJ2_ZNRD_LTEXT.lsmw.conv
    Long Texts in Total:                                1
    Successfully Transferred Long Texts:  1
    Non-Transferred Long Texts:                 0
    Now when i check the material master sales view -> sales text it is empty.
    Please help me with the same.
    Regards,
    Ranjith N

    Hello Experts, I was trying to upload sales text for a material master using LSMW direct input method.
    I followed the following steps for the same
    Tab dlimited Text file format
    MATNR             LONGTEXT                                              LINE
    MATERIAL1     LONGTEXT FOR MATERIAL MATERIAL1 1 *************************************************************************************************************
    Step1 -> Maintain object attributes
    Object -> 0001
    Method-> 0001
    Program name -> /SAPDMC/SAP_LSMW_IMPORT_TEXTS
    Program type -> D
    Step2 -> Maintain Source Structure
    Source structure -> LONG_TEXT Source structure for long text
    Step 3-> Maintain souce file Source Fields
    ZLONG_TEXT Source structure for long text
    MATNR C(018) MATNR
    LTEXT C(132) LTEXT
    Step 4-> Maintain structure relationship
    Structure Relations 
    /SAPDMC/LTXTH Long Texts:  Header <<<< ZLONG_TEXT Source structure for long text
    Select Target Structure
    /SAPDMC/LTXTH . /SAPDMC/LTXTL Long Texts: Row <<<< ZLONG_TEXT Source structure for long text
    Select Target Structure /SAPDMC/LTXTL .
    Step 5-> Maintain Field mapping and conversion rules
    Here i have assigned constan rules to couple of them like
    /SAPDMC/LTXTH Long Texts: Header
    Fields
    OBJECT            Texts: Application Object
                             Rule : Constant
                              Code: /SAPDMC/LTXTH-OBJECT = 'MVKE'.
    NAME               Name
                             Source: ZLONG_TEXT-MATNR (MATNR)
                             Rule : Transfer (MOVE)
                             Code: /SAPDMC/LTXTH-NAME = ZLONG_TEXT-MATNR.
    ID                     Text ID
                             Rule : Constant
                             Code: /SAPDMC/LTXTH-ID = '0001'.
    SPRAS             Language Key
                             Rule : Constant
                            Code: /SAPDMC/LTXTH-SPRAS = 'E'.
    /SAPDMC/LTXTL Long Texts: Row
    Fields
    TEXTFORMAT  Tag column 
                             Rule : Constant
                             Code: /SAPDMC/LTXTL-TEXTFORMAT = '/'.
    TEXTLINE          Text Line
                             Source: ZLONG_TEXT-LTEXT (LTEXT)
                             Rule : Transfer (MOVE)
                             Code: /SAPDMC/LTXTL-TEXTLINE = ZLONG_TEXT-LTEXT.
    Step6 -> Specify file Legacy
    Data On the PC (Frontend)
                 Data D:\Sales_Longtext.txt
    Step7 -> Assign File ZLONG_TEXT
    Source structure for long text
              Data D:\Sales_Longtext.txt
    Step8 -> Read data
    Output result
    Source Structure            Read                Written                Not Written
    ZLONG_TEXT                  1                       1                            0
    Transactions Read          1
    Records Read:                1
    Transactions Written:      1
    Records Written:             1
    Step 8 -> Display read data
    Field Name             Field Text                      Field Value
    MATNR                    MATNR                         MATERIA1
    LTEXT                     LTEXT                            SALES TEXT FOR Material MATERIAL1
    Step 9 -> Convert data
    File Read: ZNRD_PRJ1_ZNRD_SUBPRJ2_ZNRD_LTEXT.lsmw.read
    File Written: ZNRD_PRJ1_ZNRD_SUBPRJ2_ZNRD_LTEXT.lsmw.conv
    Transactions Read:    1
    Records Read:           1
    Transactions Written: 1
    Records Written:         2
    tep 10 -> Display converted data
    1 /SAPDMC/LTXTH     1    MVKE        MATERIAL1 0001   E
    2 /SAPDMC/LTXTL     2/   SALES TEXT FOR Material       MATERIAL1
    Step 11 -> Start direct input program
    Output result for the same
    Legacy System Migration Workbench Project:
    ZNRD_PRJ1  ORH
    Subproject:   ZNRD_SUBPRJ2     Upload long text
    Object:          ZNRD_LTEXT          Long text tru direct input
    File :              ZNRD_PRJ1_ZNRD_SUBPRJ2_ZNRD_LTEXT.lsmw.conv
    Long Texts in Total:                                1
    Successfully Transferred Long Texts:  1
    Non-Transferred Long Texts:                0
    Now when i check the material master sales view -> sales text it is empty. Please help me with the same.
    Regards,
    Ranjith N

  • Error in uploading the PO while running Direct Input porgram RM06EEI0

    Hi all
    i have written one conversion program to upload PO. Here in the program i am populating the batch input structures MBEPOH and MBEPOI and finally writing it to the unix file.
    Finally when i execute the direct input program RM06EEI0
    using the logical filename , it gives the error as 'Net price should be greater than 0' .
    i have also checked the file in the unix directory , there the net price is getting populated correctly. Also i debugged the direct input program and found out that net price is getting passed correctly to FM ME_CREATE_PO_ITEM but somewhere  the KOMP   structure is not getting populated ,that is why net price becomes 0.
    Can anybody please tell whether there is some issue in writing the conversion program or i am missing some parameters to be passed in MBEPOH or MBEPOI, or what has to be done.
    Please help me , it is urgent .
    Thanks and Regards,
    Syed

    I have the same problem, could somebody help?
    Thanx, Marian

  • Tax issue with Direct Input mode of RFBIBL00

    Hi, I have a problem using <b>RFBIBL00</b> (direct input mode) to create A/R invoices. There is no tax associated with the invoice, however, when I use direct input mode, instead of posting immediately, a batch input session is created. In the log, an <b>information</b> message: <i>'Specify a tax jurisdiction key'</i>. The BDC session is processed with no error.
    When using Call transaction mode for RFBIBL00, the document is posted immediately but the requirement is to use Direct input mode.
    There is no converted data in the BBTAX structure since the doc. does not need to post to tax account. Do I need to populate the Tax amount, Tax code and jurisdiction code in this structure and BBSEG in order to by pass the information message?
    Any advice is appreciated.
    - Minami

    Problem solved. Just need to untie the relationship between the ITEM import structure and the BBTAX so the Direct Input program will not require a tax jurisdiction code.

  • LSMW direct input method

    Hi
      What is the procedure to include a specific program / report in the drop down box of program name of Direct Input method in LSMW?
    What is the diff. between Physical path and Logical path?
    How can we give our input data using logical path when we execute some standard batch or direct input programs?
    Ex. RMDATIND.

    http://help.sap.com/saphelp_erp2005vp/helpdata/en/87/f3ae63e68111d1b3ff006094b944c8/frameset.htm
    Regards,
    Amit

  • WITH LSMW USING BATCH INPUT/DIRECT INPUT/BAPI/IDOCS

    IN WHAT SCENARIOS CAN WE USE BATCH INPUT/DIRECT INPUT/BAPI/IDOCS WITH LSMW.WHICH IS THE BEST ONE.PLEASE TELL ME THE SCENARIOS OF USAGE.

    It really depends on what you are doing.  There are a lot of "standard" LSMW objects for different business objects, for example, there is a std object for Creating Material Masters, in this case, it is a direct input program. So, the best choice here would be to use the standard program which has been provided, it just so happens that it is a direct input program.  Creating Bill of Materials is another one, but this one is a batch input program, so you have no choice but to go with that.  Of course if there is a BAPI for your business object that would be the next best thing, if a standard object does not exists.
    REgards,
    Rich Heilman

  • BDC-Direct Input

    Please give an example for Direct Input method in BDC.When it is used? what is the advantage and disadvantage?

    Hi Khanna Renga ,
    Direct Input method is used for bulk transfer of data into SAP system.It results in faster execution since no screens are processed and the SAP database will be updated directly using the standard function modules.
    Better example where direct input method will be used is... uploading the data for material master.....it includes lot of views so its very much difficult to capture all the views and record the tcode and map the data in such conditions its better to go with DI methods
    Advantages:
    in session method or Call Transaction method while uploading the data u do the validation by fallowing the screen sequence and field sequence where as in Direct Input validations can be done set of code so this make the process very fast so its advantageous to upload large amout of data.
    you always use the standard sap provided program for this.
    Here in Direct Input method very important thing is structure of flat file... so to know the structure first of all you have to download the data for one record into the internal table with the use of the same program then with the use of that structure u have to desing the flat file and upload the data.
    Direct Input:
    With direct input, the SAP function modules execute the consistency checks. However with batch input, these consistency checks are executed with help of the screens. This means that direct input has considerable performance advantages. But there are a few programs for direct input, you can use them if it accomplishes your goal. Direct Input programs work like that they update database tables directly. As you know that it is forbidden to update SAP database tables directly, since consistency and security should be considered. Exceptions are these direct input programs. So you are not able to write custom ABAP direct input programs. But of course you can write ABAP programs to update custom database tables (Z tables), if you are sure all about consistency.
    SAP has created direct input programs because SAP wanted to enhance the batch input procedure, since batch input is slower. SAP offers the direct input technique, especially for transferring large amount of data. In contrast to batch input, this technique does not create sessions, but stores, updates, inserts data directly. To enter the data into the corresponding database tables directly, the system calls a number of function modules that execute any necessary checks. In case of errors, the direct input technique provides a restart mechanism. However, to able to activate the restart mechanism, direct input programs must be executed in the background only. To maintain and start these programs, use program RBMVSHOW or transaction BMV0.
    Examples for direct input programs are:
    RFBIBL00 - FI
    RMDATIND - MM
    RVAFSS00 - SD
    RAALTD11 - AM
    RKEVEXTO - CO-PA
    Also have a look on below thread..
    Re: re: direct input method
    Re: Give a BDC example by Direct Input Method
    In contrast to batch input, this technique does not create sessions, but stores the data directly. It does not simulate the online transaction. To enter the data into the corresponding database tables directly, the system calls a number of function modules that execute any necessary checks. In case of errors, the direct input technique provides a restart mechanism. However, to be able to activate the restart mechanism, direct input programs must be executed in the background only. Direct input checks the data thoroughly and then updates the database directly.
    Hope it will solve your doubts and problem..
    Reward points if useful..
    Thanks & Regards
    ilesh 24x7

Maybe you are looking for