Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Transaction BP start in sales area - status view screen

I'm calling from outside of R/3 (from CRM).

I want to start online transaction BP started, but I want to start up in the sales area, and the screen status. This is crucial because it is must be done several times by the users.

I have tried to see examples in the code how memory with structure BUS_NAVIGATION is filled. But it does not work.

Any suggestions?

BR

Bent Holm Nielsen

bhn@egmont.com

FUNCTION ZE_SD_CIC_CALL_TRANS_BP.
*"----------------------------------------------------------------------
*"*"Local interface:
*"  IMPORTING
*"     VALUE(TCODE) TYPE  TCODE
*"     VALUE(KUNNR) TYPE  KUNNR OPTIONAL
*"----------------------------------------------------------------------
  DATA lv_key(34) TYPE c.
  DATA ls_indx    TYPE indx.

  constants: gc_shared_buffer_id type INDX-SRTFD value
            'BUPA_NAVIGATION_REQ'.

  data: ev_instance type ref to CL_BUPA_NAVIGATION_REQUEST.
  data GS_NAVIGATION type BUS_NAVIGATION .
  data GS_NAVIGATIONX type BUS_NAVIGATIONX .
  data GV_TITLE type BUS_SCREEN-TITLE .

  if tcode eq 'BP' and not kunnr is initial.
    SELECT single PARTNER_GUID into gs_navigation-PARTNER_GUID
           FROM  BUT000
           WHERE  PARTNER       = kunnr.
    if sy-subrc gt 0.
      exit.
    endif.
    data: lt_role type BU_role_t,
          ls_role type BU_RLTYP,
          lin type i.

    refresh lt_role.
    SELECT RLTYP appending table lt_role
           FROM  BUT100
           WHERE  PARTNER  = kunnr.
    describe table lt_role lines lin.
    if lin le '1'.
      read table lt_role into ls_role index 1.
      if sy-subrc eq 0.
        gs_navigation-BUPA-PARTNER_ROLE = ls_role.
      else.
        exit.    "The function module
      endif.
    else.
      read table lt_role into ls_role
                 with key 'ZCRM01'.  "sold-to
      if sy-subrc eq 0.
        gs_navigation-BUPA-PARTNER_ROLE = ls_role.
      else.
        read table lt_role into ls_role index 1.
        if sy-subrc eq 0.
          gs_navigation-BUPA-PARTNER_ROLE = ls_role.
        else.
          exit.    "The function module
        endif.
      endif.
    endif.
* Start Export data to the ABAP memory
    gs_navigation-bupa-activity       = '02'.
    gs_navigation-bupa-sub_header_id  = 'LOCU90'. "Status screen at bp
    gs_navigation-bupa-sub_header_tab = 'LOCU90'. "Status screen at bp

*Break sapbhn.
*data: lt_fields type table of BUS0FLDVAL,
*      ls_fields type BUS0FLDVAL.
*
*    ls_fields-TBFLD = 'RF02D-VKORG'.
*    ls_fields-FLDVL = 'S001'.
*    insert ls_fields into table lt_fields.
*    gs_navigation-bupa-FIELD_VALUES[] = lt_fields[].


    CONCATENATE gc_shared_buffer_id sy-uname INTO lv_key.
    gs_navigationx-partner_guid      = 'X'. "Guid
    gs_navigationx-bupa-partner_role = 'X'. "Role
    gs_navigationx-bupa-activity     = 'X'. "Change mode

    EXPORT gs_navigation  FROM gs_navigation
           gs_navigationx FROM gs_navigationx
           gv_title       FROM gv_title
           TO DATABASE indx(bp) FROM ls_indx ID lv_key.
* End  Export data to the ABAP memory
    call transaction 'BP'.
  endif.

Tags:
Not what you were looking for? View more on this topic or Ask a question