cancel
Showing results for 
Search instead for 
Did you mean: 

Mass upload of Fixed Bin Mappings

venkatasasidhargupta_gada
Active Participant

Hi All

Is there any way to define fixed bin mappings using CSV file etc? I know the transaction /scwm/binmat but here we can't upload for all fixed bins through csv etc.. or using the config where first posting will fix the product to bin. But I am looking for a csv file upload like we do for storage bins and stock uploads in EWM.

Thanks

Sasidhar Gupta

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello,

i added an upload Button to the standard /scwm/binmat to read the csv file and i tried afterwards to parse and append data to the alv grid table.

But it doesn't really work and i still can't raise the check_data event to verify the inserted rows. Hier is my code...

WHEN '&FILE&UPLOAD'.

          CALL FUNCTION 'WS_FILENAME_GET'

             EXPORTING

               MASK             = '*.csv' "',*.*,*.'

               MODE             = 'O'

             IMPORTING

               FILENAME         = P_FILE

             EXCEPTIONS

               INV_WINSYS       = 1

               NO_BATCH         = 2

               SELECTION_CANCEL = 3

               SELECTION_ERROR  = 4

               OTHERS           = 5.

   CALL FUNCTION 'GUI_UPLOAD'

       EXPORTING

         FILENAME                      = P_FILE

        FILETYPE                      = 'ASC'

        HAS_FIELD_SEPARATOR           = 'X'

        READ_BY_LINE                  = 'X'

       TABLES

         DATA_TAB                      = lt_data

      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.

* Implement suitable error handling here

     ENDIF.

     l_mode = cl_gui_alv_grid=>MC_STYLE_DISABLED.

     LOOP AT lt_data INTO LV_RAW_DATA.

         SPLIT LV_RAW_DATA

             AT    ';'

             INTO

             ls_bin_mat-lgnum

             ls_bin_mat-entitled

             ls_bin_mat-lgpla

             ls_bin_mat-lgtyp

             ls_bin_mat-matnr

             ls_bin_mat-improv_fix

             ls_bin_mat-datout

             ls_bin_mat-maxqty

             ls_bin_mat-maxqty_uom_dsp

             ls_bin_mat-minqty

             ls_bin_mat-minqty_uom_dsp

             ls_bin_mat-rmmqty_fix

             ls_bin_mat-created_at

             ls_bin_mat-created_by.

       Append ls_bin_mat to lt_bin_mat.

     ENDLOOP.

     IF me->mo_data_changed IS INITIAL.

        CREATE OBJECT me->mo_data_changed

          exporting

            I_CALLING_ALV g_grid   " Rufender ALV

          .

      ENDIF.

     CREATE DATA G_VERIFIER->MO_DATA_CHANGED->MP_MOD_ROWS LIKE LT_OUTTAB.

     ASSIGN G_VERIFIER->MO_DATA_CHANGED->MP_MOD_ROWS->* TO <data>.

     LOOP AT lt_bin_mat INTO ls_bin_mat.

         CLEAR ls_outtab.

         CLEAR ls_mod_rows.

         CLEAR ls_mod_cells.

         lv_index = sy-tabix.

         REFRESH lt_celltab.

         "'LGNUM'

         ls_outtab-lgnum = ls_bin_mat-LGNUM.

         ls_mod_cells-LGNUM = ls_bin_mat-LGNUM.

         ls_mod_rows-ROW_ID = lv_index.

         ls_mod_rows-TABIX = lv_index.

         ls_mod_rows-FIELDNAME = 'LGNUM'.

         ls_mod_rows-VALUE = ls_mod_cells-LGNUM.

         APPEND ls_mod_rows TO LT_MOD_ROWS.

         "'LGTYP'

         ls_outtab-LGTYP   = ls_bin_mat-LGTYP.

         ls_mod_rows-ROW_ID = lv_index.

         ls_mod_rows-TABIX = lv_index.

         ls_mod_rows-FIELDNAME = 'LGTYP'.

         ls_mod_rows-VALUE = ls_outtab-LGTYP.

         APPEND ls_mod_rows TO LT_MOD_ROWS.

         "'OUTCON'

         ls_outtab-OUTCON = ls_bin_mat-IMPROV_FIX.

         ls_mod_rows-ROW_ID = lv_index.

         ls_mod_rows-TABIX = lv_index.

         ls_mod_rows-FIELDNAME = 'OUTCON'.

         ls_mod_rows-VALUE = ls_outtab-OUTCON.

         APPEND ls_mod_rows TO LT_MOD_ROWS.

         "'MAXQTY'

         ls_outtab-MAXQTY    = ls_bin_mat-MAXQTY.

         ls_mod_rows-ROW_ID = lv_index.

         ls_mod_rows-TABIX = lv_index.

         ls_mod_rows-FIELDNAME = 'MAXQTY'.

         ls_mod_rows-VALUE = ls_outtab-MAXQTY.

         APPEND ls_mod_rows TO LT_MOD_ROWS.

         "'MAXQTY_UOM_DSP'

         ls_outtab-MAXQTY_UOM_DSP = ls_bin_mat-MAXQTY_UOM_DSP.

         ls_mod_rows-ROW_ID = lv_index.

         ls_mod_rows-TABIX = lv_index.

         ls_mod_rows-FIELDNAME = 'MAXQTY_UOM_DSP'.

         ls_mod_rows-VALUE = ls_outtab-MAXQTY_UOM_DSP.

         APPEND ls_mod_rows TO LT_MOD_ROWS.

         "'MINQTY'

         ls_outtab-MINQTY    = ls_bin_mat-MINQTY.

         ls_mod_rows-ROW_ID = lv_index.

         ls_mod_rows-TABIX = lv_index.

         ls_mod_rows-FIELDNAME = 'MINQTY'.

         ls_mod_rows-VALUE = ls_outtab-MINQTY.

         APPEND ls_mod_rows TO LT_MOD_ROWS.

         "'MINQTY_UOM_DSP'

         ls_outtab-MINQTY_UOM_DSP = ls_bin_mat-MINQTY_UOM_DSP.

         ls_mod_rows-ROW_ID = lv_index.

         ls_mod_rows-TABIX = lv_index.

         ls_mod_rows-FIELDNAME = 'MINQTY_UOM_DSP'.

         ls_mod_rows-VALUE = ls_outtab-MINQTY_UOM_DSP.

         APPEND ls_mod_rows TO LT_MOD_ROWS.

         "'RMMQTY_FIX'

         ls_outtab-RMMQTY_FIX = ls_bin_mat-RMMQTY_FIX.

         ls_mod_rows-ROW_ID = lv_index.

         ls_mod_rows-TABIX = lv_index.

         ls_mod_rows-FIELDNAME = 'RMMQTY_FIX'.

         ls_mod_rows-VALUE = ls_outtab-RMMQTY_FIX.

         APPEND ls_mod_rows TO LT_MOD_ROWS.

         ls_outtab-ENTITLED = ls_bin_mat-ENTITLED.

         ls_mod_cells-ENTITLED = ls_bin_mat-ENTITLED.

         ls_mod_rows-ROW_ID = lv_index.

         ls_mod_rows-TABIX = lv_index.

         ls_mod_rows-FIELDNAME = 'ENTITLED'.

         ls_mod_rows-VALUE = ls_outtab-ENTITLED.

         APPEND ls_mod_rows TO LT_MOD_ROWS.

         ls_outtab-LGPLA  = ls_bin_mat-LGPLA.

         ls_mod_cells-LGPLA = ls_bin_mat-LGPLA.

         ls_outtab-MATNR   = ls_bin_mat-MATNR.

         ls_celltab-fieldname = 'CREATED_AT'.

         ls_celltab-style = l_mode.

         INSERT ls_celltab INTO TABLE lt_celltab.

         ls_celltab-fieldname = 'CREATED_BY'.

         ls_celltab-style = l_mode.

         INSERT ls_celltab INTO TABLE lt_celltab.

         ls_celltab-fieldname = 'COUNT'.

         ls_celltab-style = l_mode.

         INSERT ls_celltab INTO TABLE lt_celltab.

         ls_celltab-fieldname = 'DATOUT'.

         ls_celltab-style = l_mode.

         INSERT ls_celltab INTO TABLE lt_celltab.

         INSERT lines of lt_celltab INTO TABLE ls_outtab-celltab.

         APPEND ls_outtab TO gt_outtab.

         APPEND ls_mod_cells TO me->MODIFIED_ROWS.

     ENDLOOP.

PERFORM build_fieldcat CHANGING pt_fieldcat.

me->MO_DATA_CHANGED->MT_FIELDCATALOG = pt_fieldcat.

INSERT LINES OF LT_MOD_ROWS INTO TABLE me->MO_DATA_CHANGED->MT_MOD_CELLS.

INSERT LINES OF LT_MOD_ROWS INTO TABLE me->MO_DATA_CHANGED->MT_GOOD_CELLS.

INSERT LINES OF GT_OUTTAB   INTO TABLE <data>.

CALL METHOD g_grid->refresh_table_display.

GS_LAYOUT-STYLEFNAME = 'CELLTAB'.

*     Force the GridModified flag to on

       CALL METHOD g_grid->IF_CACHED_PROP~SET_PROP

         EXPORTING

           propname           = 'GridModified'

           propvalue          = '1'

         EXCEPTIONS

           others             = 0.

DATA l_valid TYPE char01.

CALL METHOD g_grid->check_changed_data

     IMPORTING

       e_valid = l_valid.

CALL METHOD G_VERIFIER->HANDLE_DATA_CHANGED

   exporting

     ER_DATA_CHANGED = me->MO_DATA_CHANGED

  .

CALL METHOD g_grid->refresh_table_display.

jaymin_thakkar05
Explorer
0 Kudos

Hi Amara,

Did you find any solution, I have same requirement Mass Uploading using csv file on /scwm/binmat.

Former Member
0 Kudos

Hi,

unfortunately not!

jaymin_thakkar05
Explorer
0 Kudos

Hi,

You need to develop a custom LSMW and u need to use /scwm/fb_update FM to update the table /scwm/binmat. I have solved my issue by calling the above FM.

Answers (6)

Answers (6)

venkatasasidhargupta_gada
Active Participant
0 Kudos

Hi All

If you are not going for any custom development, it is better to manage this with config settings. Make relevant settings in storage type definition so that whenever you upload initial stock in the bins of those storage type, system automatically makes entries in BINMAT table.

Regards

Sasidhar Gupta

JuergenPitz
Product and Topic Expert
Product and Topic Expert
0 Kudos

Man, that is actually the easiest one...

0 Kudos

Where is this check in Storage Type? This seems easy option.

0 Kudos

Hi you can use an LSMW with SM30/SE16(n) on table  /SCWM/V_BINMAT, with F5.

jaymin_thakkar05
Explorer
0 Kudos

Hi,

You need to develop a custom LSMW and u need to use /scwm/fb_update FM to update the table /scwm/binmat. I have solved my issue by calling the above FM.

shimank_jain3
Explorer
0 Kudos

Hi Jasmin,

There is an easy way for mass data upload by excel file into SAP ECC / EWM system.

Below is the steps to be followed for the uploading process :

  1. First create the recording for the transaction like ( /N/SCWM/MAT1 )
  2. Download your recording into word file.
  3. Replace the Input fields with ( MERGE FIELDS Columns in MS Word )

          ( MS Word -> Insert -> Quick Parts -> Field ).

   4.  Create your Excel file with your input records.

   5.  Upload the Excel sheet into MS Word file by step-by-step wizard tool.

   6.  Copy the newly generated file into NOTEPAD File and save it.

   7.  Import the file into SAP System by the help of Created Recording and execute, all the excel data          may upload into SAP System.

Thanks,

Shimank Jain

jaymin_thakkar05
Explorer
0 Kudos

Hi Shinmank,

I know how to upload mas data by excel file for "other like transaction".

My question is for /SCWM/BINMAT. Please suggest for the transaction I mentioned, as going further in the transaction data is being updated in database through ALV grid,and as maybe you would be knowing that we cannot record the steps of ALV Grid as it is a Enjoy Control.

JuergenPitz
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi,

from 9.0 on you have several migration tool transactions in EWM, one is for the Warehouse Product Migration. In there you can select to "migrate fixed bin assignements". Warehouse Product Migration - Migration from LE-WM - SAP Library

Now the general idea of the transaction is to migrate from ERP to EWM, means first you create the file with the ERP data with this transaction and then you upload - but of course no-one is forcing you to do the first step. You need to test about the file format, I did not really look now into the documentation in depth.

Brgds

Juergen


Former Member
0 Kudos

Hello

You can use LSMW.

Best regards

Carlos Díaz