cancel
Showing results for 
Search instead for 
Did you mean: 

Creating Product specific means of transport.

bhuvanpaliwal
Explorer
0 Kudos

Hi everyone,

I need to create a program for mass creation of Prod. specific means of transport, for already existing transportation lanes.

I want to know whether this can be done using any of the below 2 BAPIs:

BAPI_TRLSRVAPS_SAVEMULTI

BAPI_TRLSRVAPS_SAVEMULTI2


If yes, then it would be great if anyone could guide me with all the parameters that I need to pass in this BAPI.


If no, then how can this be done easily, for mass creation.



Many thanks,

Bhuvan Paliwal

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello Bhuvan,

Step 1: Execute Transaction /N/SAPAPO/SCC_TL1, and enter details as required

Step 2: Click on Create New button

Step 3: Select radio button for Mass Selection and then Tab Mass Se
Step 4: Enter all products for which Transportation Lane to be maintained here and click execute below. Then again select all products in the next pop up and click continue.
Step 5:  Give Start Date and End Date as Validity and then click Continue.

Step 6: Select the MOT XXXX Line and then click on Product-Specific Means of Transport and then Click on Create.

Step 7: Click New and then select the radio button Copy all Existing Products and then Copy, Click Ok on the information pop up and then Click on Copy and Close.


Let me know if you need more information.

Answers (4)

Answers (4)

thanga_prakash
Active Contributor
0 Kudos

Hello Bhuvan,

Try the below code. I have tried and it worked for me.


* Update/create product specific means of transport

  CALL FUNCTION 'BAPI_TRLSRVAPS_SAVEMULTI'

    EXPORTING

      logical_system          = lf_rfc

      model                   = lf_model

      commit_control          = 'E'

      auto_delete             = ''

    TABLES

      prod_means_of_transport = lt_prod_means_of_transport

      prod_means_of_transportx = lt_prod_means_of_transportx

      return                  = lt_return.

logical system --> RFC connection

model --> Material

commit control -->  blank or E or A (if blank then COMMIT won't done automatically, if E COMMIT is done automatically and rollback will be done in case of error message, if A COMMIT is done automatically and rollback will be done in case of abort message)

auto_delete --> leave it as blank, this is for deleting the existing transportation lane

Fill the below fields for prod_means_of_transport and prod_means_of_transportx.

location_from   

loctype_loc_from

location_to     

loctype_loc_to  

product         

ttype_valfr     

ttype_valto     

ttype           

product_valfr   

product_valto   

lot_size_profile

Regards,

Thanga

Former Member
0 Kudos

Hi Bhuvan,

If it was helpful for you please validate the right answers. So, the others consultant can benefit!

Thanks.

Regards, Marius 

marianoc
Active Contributor
0 Kudos

Hi,

You can mass upload materials directly in /SAPAPO/SCC_TL1. You can copy and paste a list of materials in seconds.

In case you need to write a program, in this blog you have a sample code:

seshagiri


data : lt_PRODUCT_PROCUREMENT TYPE TABLE OF  BAPI11201TRPRODLANE2,

       lw_PRODUCT_PROCUREMENT TYPE  BAPI11201TRPRODLANE2.

data : lt_PRODUCT_PROCUREMENTx TYPE TABLE OF  BAPI11201TRPRODLANE2,

  lw_PRODUCT_PROCUREMENTx TYPE  BAPI11201TRPRODLANE2.

LOOP AT gt_final into gw_final.

lw_PRODUCT_PROCUREMENT-MODEL = '000'.

lw_PRODUCT_PROCUREMENT-LOCATION_FROM = gw_final-LOCNOFR.

lw_PRODUCT_PROCUREMENT-LOCATION_TO = gw_final-LOCNOTO.

lw_PRODUCT_PROCUREMENT-PRODUCT    = gw_final-MATNR.

lw_PRODUCT_PROCUREMENT-DISTRIBUTION_PRIORITY = gw_final-DPRIO.

APPEND lw_PRODUCT_PROCUREMENT to lt_PRODUCT_PROCUREMENT.

CLEAR : lw_PRODUCT_PROCUREMENT.

lw_PRODUCT_PROCUREMENTx-MODEL = '000'.

lw_PRODUCT_PROCUREMENTx-LOCATION_FROM = gw_final-LOCNOFR.

lw_PRODUCT_PROCUREMENTx-LOCATION_TO = gw_final-LOCNOTO.

lw_PRODUCT_PROCUREMENTx-PRODUCT    = gw_final-MATNR.

lw_PRODUCT_PROCUREMENTx-DISTRIBUTION_PRIORITY = 'X'.

APPEND lw_PRODUCT_PROCUREMENTx to lt_PRODUCT_PROCUREMENTx.

CLEAR : lw_PRODUCT_PROCUREMENTx.

ENDLOOP.

CALL FUNCTION 'BAPI_TRLSRVAPS_SAVEMULTI2'

  EXPORTING

    LOGICAL_SYSTEM                       = GW_LOGSYS

   BUSINESS_SYSTEM_GROUP                = GW_BSGGROUP

TABLES

   PRODUCT_PROCUREMENT                  = lt_PRODUCT_PROCUREMENT

   PRODUCT_PROCUREMENT_X                = lt_PRODUCT_PROCUREMENTx

   RETURN                               = gT_RETURN.

READ TABLE gT_RETURN into gw_RETURN with key type = 'E'.

      IF sy-subrc <> 0.

        CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

          EXPORTING

            wait = 'X'.

ENDIF.

Kind Regards,

Mariano

Former Member
0 Kudos

Hi Mariano,

He needs a solution for product specific means of transport not for prod.specific transportation lane!

However in the product specific means of transport you have the possibility to choose Copy all Existing Products. So, I imagine that all products that are specific transportation lanes will be copied.

Thanks.

Regards, Marius

marianoc
Active Contributor
0 Kudos

You are right Marius. Thanks

So Bhuvan Paliwal forget the first part of my replay.. Use the sample code to see how to use that Function Module.

Kind Regards,

Mariano

bhuvanpaliwal
Explorer
0 Kudos

Thanks for your replies Marius, Mariano.

I'm trying to get the BAPI to work in test mode (SE37).

I'm entering To and From Location and Product in tables PROD_PROC_MEANS_OF_TRANSPORT and PROD_PROC_MEANS_OF_TRANSPORT_X.

But it is not working. Gives an error saying "No valid Location could be found".

I debugged a little and found that the internal GUIDs for Locations and Product are not getting assigned. But I can't find a field to pass these GUIDs to the BAPI.

Best Regards,

Bhuvan Paliwal

Former Member
0 Kudos

Hi Bhuvan,

Try with transaction Product View to find the ID for what you want. Once in the transaction enter GT_IO in the command file and press enter. In the new view you will have the ID for locations, products, etc...

Thanks.

Regards, Marius


Former Member
0 Kudos

Hi,

You can do this with the program FUNCTION_LOADER_INLAY.

Enter a file name then in the Design tab enter your BAPI as name of put function model and press enter. From parameters name list you select logical name, business system group, etc.. and you transfer them on the right side. Then you click Format Worksheet to generate excel file. In the excel file you put the parameters values and then to load data in the system you press button SAP System.

Thanks.

Regards, Marius

Former Member
0 Kudos

Hi Marius,

Have you ever used FUNCTION_LOADER_INLAY successfully to change master data ? If so can you please share the steps in details.

Thanks