cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Link from TM Freight booking to commercial Invoice

petra_just
Active Participant
0 Likes
949

hi experts,

in our process, we had the requirement to create a commercial invoice for all deliveries related to the package units attached to a given freight booking. We did that via a button on the freight booking. The invoice creation works now. In addition, the business has asked us now to add a link where they can navigate from the TM freight booking to the invoice gui transaction VF03. In order to do that, I need to assign a n action class in the floor plan manager befind the link (see attachment). In the action, I need to use class cl_fpm_factory, but which data to pass and how to do the coding? While I am waiting for the answer, I will add screenshots of the link in FPM and of the freight booking with the link.

Thanking you in advance for any hint.

Regards

Petra

Accepted Solutions (0)

Answers (2)

Answers (2)

petra_just
Active Participant
0 Likes

Hi Dragos,

thank you for your valuable advise. I have done the following coding, but it does not work.

where do I find the ok code for batch input? Found the batch code ok code as attached in system status of the invoice entry screen. But, my coding still does not work. Please help.

  CHECK lt_root IS NOT INITIAL.
    READ TABLE lt_root ASSIGNING FIELD-SYMBOL(<ls_root>) INDEX 1.

    lv_fb_key = <ls_root>-key.
    lv_fb_id  = <ls_root>-tor_id.
    lv_invoice = <ls_root>-zz_tm_inv_link.
    lv_base_btd_id = lv_invoice.

    "Call the invoice in  gui
    cl_fpm_factory=>get_instance( )->get_navigate_to( )->launch_transaction(
        is_transaction_fields = VALUE #(
            tcode        = 'VF02'
            parameter    = VALUE #( ( key = 'VBRK-VBELN'
                                      value = lv_base_btd_id )
                                   )
          )
        is_additional_parameters = VALUE #(
            batch_input_program  = 'SAPMV60A'
            batch_input_dynnr    = '104'
            batch_input_ok_code  = 'AEND'
            navigation_mode      = 'EXT_HEAD'
            window_features      = 'toolbar=no, resizable=yes'
            parameter_forwarding = 'G'
            history_mode         = 2
          )
      ).

gui-code.jpg

Drago
Product and Topic Expert
Product and Topic Expert
0 Likes

Hi,

You must use the FPM navigation API. First get hold of the required singleton:

DATA(o_fpm) = cl_fpm_factory=>get_instance( ).
DATA(o_nav) = o_fpm->get_navigate_to( ).

then call its corresponding method:

o_nav->launch_transaction( 
  is_transaction_fields    = fields
  is_additional_parameters = addparams ).

in which of course you must define the structures fields and addparams as per method's signature and fill them accordingly.

Alternately, you can use a one statement to rule them all:

    cl_fpm_factory=>get_instance( )->get_navigate_to( )->launch_transaction(
        is_transaction_fields = VALUE #(
            tcode        = "enter your target tcode, e.g. 'VF03'
            parameter    = VALUE #( ( key = "enter DYNP field name for ID, e.g. 'VBRK-VBELN'
                                      value = "enter the taget document ID ) 
                                   )
          )
        is_additional_parameters = VALUE #(
            navigation_mode      = 'EXT_HEAD' ##no_text
            window_features      = 'toolbar=no, resizable=yes' ##no_text
            parameter_forwarding = 'G'
            history_mode         = 2
          )
      ).

the <DYNP field name> can be found out using Help > Technical Information when being positioned in the relevant field, e.g. 'VBRK-VBELN'. On the same dialog you can find the program name and screen number that you optionally pass into corresponding components of addparams.

Best regards,
DragoÈ™ Florescu