Skip to Content
author's profile photo Former Member
Former Member

how to select a basic data view of t-code 'mm43'in call transaction method

my program is as follows:

but i am getting an error message that screen sequence could be selected......

TABLES :ekko, ekpo.

TYPE-POOLS: slis.

DATA :

BEGIN OF iekko OCCURS 0,

ebeln TYPE ekko-ebeln,

bukrs TYPE ekko-bukrs,

bstyp TYPE ekko-bstyp,

bsart TYPE ekko-bsart,

bsakz TYPE ekko-bsakz,

loekz TYPE ekko-loekz,

statu TYPE ekko-statu,

aedat TYPE ekko-aedat,

END OF iekko.

DATA :

BEGIN OF iekpo OCCURS 0,

ebeln TYPE ekpo-ebeln,

matnr TYPE ekpo-matnr,

ematn TYPE ekpo-ematn,

bukrs TYPE ekpo-bukrs,

werks TYPE ekpo-werks,

lgort TYPE ekpo-lgort,

bednr TYPE ekpo-bednr,

matkl TYPE ekpo-matkl,

END OF iekpo.

DATA : BEGIN OF final OCCURS 0,

ebeln LIKE ekko-ebeln,

bukrs LIKE ekko-bukrs,

bstyp LIKE ekko-bstyp,

bsart LIKE ekko-bsart,

bsakz LIKE ekko-bsakz,

loekz LIKE ekko-loekz,

statu LIKE ekko-statu,

matnr LIKE ekpo-matnr,

ematn LIKE ekpo-ematn,

werks LIKE ekpo-werks,

lgort LIKE ekpo-lgort,

bednr LIKE ekpo-bednr,

matkl LIKE ekpo-matkl,

END OF final.

DATA : i_repid TYPE sy-repid,

final_cat LIKE TABLE OF final,

wa_final TYPE final.

DATA : int_fcat TYPE slis_t_fieldcat_alv,

wa_layout TYPE slis_layout_alv,

v_ebeln TYPE ekko-ebeln,

v_matnr TYPE ekpo-matnr,

it_events TYPE slis_alv_event,

gt_events TYPE slis_t_event.

DATA: bdcdata TYPE TABLE OF bdcdata WITH HEADER LINE,

zdata TYPE TABLE OF bdcdata.

SELECT-OPTIONS : s_ebeln FOR ekko-ebeln,

s_bukrs FOR ekko-bukrs,

s_aedat FOR ekko-aedat,

s_bsart FOR ekko-bsart,

s_ebelp FOR ekpo-ebelp.

START-OF-SELECTION.

SELECT ebeln

bukrs

bstyp

bsart

bsakz

loekz

statu

FROM ekko

INTO CORRESPONDING FIELDS OF TABLE iekko

WHERE ebeln IN s_ebeln.

SELECT ebeln

matnr

ematn

bukrs

werks

lgort

bednr

matkl

FROM ekpo INTO TABLE iekpo

FOR ALL ENTRIES IN iekko WHERE ebeln EQ iekko-ebeln.

SORT iekpo BY ebeln.

LOOP AT iekko.

READ TABLE iekpo WITH KEY ebeln = iekko-ebeln BINARY SEARCH.

IF sy-subrc EQ 0.

MOVE : iekko-ebeln TO final-ebeln,

iekko-bukrs TO final-bukrs,

iekko-bstyp TO final-bstyp,

iekko-bsart TO final-bsart,

iekko-bsakz TO final-bsakz,

iekko-loekz TO final-loekz,

iekko-statu TO final-statu,

iekpo-matnr TO final-matnr,

iekpo-ematn TO final-ematn,

iekpo-werks TO final-werks,

iekpo-lgort TO final-lgort,

iekpo-bednr TO final-bednr,

iekpo-matkl TO final-matkl.

APPEND final.

CLEAR final.

CLEAR iekko.

CLEAR iekpo.

ENDIF.

ENDLOOP.

i_repid = sy-repid.

wa_layout-zebra = 'X'.

CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'

EXPORTING

i_program_name = i_repid

i_internal_tabname = 'FINAL'

i_inclname = i_repid

CHANGING

ct_fieldcat = int_fcat

EXCEPTIONS

inconsistent_interface = 1

program_error = 2

OTHERS = 3.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

i_callback_program = i_repid

i_callback_user_command = 'USER_COMMAND1 '

i_callback_top_of_page = 'TOP'

i_callback_html_end_of_list = 'END_OF_LIST_HTML'

is_layout = wa_layout

it_fieldcat = int_fcat

i_save = 'A'

i_screen_start_column = 1

i_screen_start_line = 2

i_screen_end_column = 1000

i_screen_end_line = 2000

TABLES

t_outtab = final

EXCEPTIONS

program_error = 1

OTHERS = 2.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

*&---------------------------------------------------------------------*

*& Form end_of_list_html

*&---------------------------------------------------------------------*

* text

*----------------------------------------------------------------------*

* -->END text

*----------------------------------------------------------------------*

FORM end_of_list_html USING end TYPE REF TO cl_dd_document.

CALL METHOD end->add_text

EXPORTING

text = ' B & Q ------>"THE KINGFISHER"'.

ENDFORM. "end_of_list_html

DATA : wa_listheader TYPE slis_t_listheader WITH HEADER LINE.

*&---------------------------------------------------------------------*

*& Form TOP-OF-PAGE

*&---------------------------------------------------------------------*

* text

*----------------------------------------------------------------------*

FORM top.

wa_listheader-typ = 'S'.

wa_listheader-key = 'DATE'.

wa_listheader-info = sy-datum.

WRITE sy-datum TO wa_listheader-info.

APPEND wa_listheader.

wa_listheader-typ = 'S'.

wa_listheader-key = 'TIME'.

wa_listheader-info = sy-uzeit.

WRITE sy-uzeit TO wa_listheader-info.

APPEND wa_listheader.

wa_listheader-typ = 'S'.

wa_listheader-key = 'CLIENT'.

wa_listheader-info = sy-mandt.

APPEND wa_listheader.

CLEAR wa_listheader.

CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'

EXPORTING

it_list_commentary = wa_listheader[]

i_logo = 'ENJOYSAP_LOGO'.

* i_end_of_list_grid = 'END'.

ENDFORM. "TOP-OF-PAGE

*&---------------------------------------------------------------------*

*& Form USER_COMMAND1

*&---------------------------------------------------------------------*

* text

*----------------------------------------------------------------------*

* -->UCOMM text

* -->RS_SELFIELD_EKPO text

*----------------------------------------------------------------------*

FORM user_command1 USING ucomm TYPE sy-ucomm

CHANGING rs_selfield_ekpo TYPE slis_selfield.

CASE ucomm.

WHEN '&IC1'.

IF rs_selfield_ekpo-fieldname = 'EBELN'.

SET PARAMETER ID 'BES' FIELD v_ebeln.

CALL TRANSACTION 'ME23N' AND SKIP FIRST SCREEN.

ELSE.

MESSAGE 'invalid field' TYPE 'S'.

ENDIF.

ENDCASE.

CASE ucomm.

WHEN '&IC1'.

IF rs_selfield_ekpo-fieldname = 'MATNR'.

SET PARAMETER ID 'MAT' FIELD v_matnr.

CLEAR bdcdata.

PERFORM bdc_dynpro USING 'SAPLMGMW' '0100'.

PERFORM bdc_field USING 'BDC_CURSOR'

'RMMW1-MATNR'.

PERFORM bdc_field USING 'RMMW1-MATNR'

v_matnr.

PERFORM bdc_field USING 'MSICHTAUSW-KZSEL(01)'

'X'.

CALL FUNCTION 'MATERIAL_BTCI_SELECTION_NEW'

EXPORTING

material = v_matnr

selection = 'K'

tcode = 'MM43'

TABLES

btci_d0070 = zdata

EXCEPTIONS

material_not_found = 1

material_number_missing = 2

material_type_missing = 3

material_type_not_found = 4

no_active_dynpro_selected = 5

no_authority = 6

OTHERS = 7.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

APPEND LINES OF zdata TO bdcdata.

CLEAR v_matnr.

CALL TRANSACTION 'MM43' USING bdcdata MODE 'E'.

ENDIF.

ENDCASE.

ENDFORM. "user_command1

*&---------------------------------------------------------------------*

*& Form BDC_DYNPRO

*&---------------------------------------------------------------------*

* text

*----------------------------------------------------------------------*

* -->PROGRAM text

* -->DYNPRO text

*----------------------------------------------------------------------*

FORM bdc_dynpro USING program dynpro.

CLEAR bdcdata.

bdcdata-program = program.

bdcdata-dynpro = dynpro.

bdcdata-dynbegin = 'X'.

APPEND bdcdata.

ENDFORM. "BDC_DYNPRO

*----------------------------------------------------------------------*

* Insert field *

*----------------------------------------------------------------------*

FORM bdc_field USING fnam fval.

CLEAR bdcdata.

bdcdata-fnam = fnam.

bdcdata-fval = fval.

APPEND bdcdata.

ENDFORM. "BDC_FIELD

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Best Answer
    Posted on Feb 22, 2014 at 07:25 AM

    Hi,

    Instead of calling Call Transaction try to use function module 'MATERIAL_MAINTAIN_DIAL_RETAIL'.

    Pass " P_PSTAT' value.

    Thanks & Regards

    Bala Krishna

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Feb 21, 2014 at 02:56 PM

    Hi.

    Check ur code, in the user_command1

    when you set the parameter, EJ:

    WHEN '&IC1'.

    IF rs_selfield_ekpo-fieldname = 'EBELN'.

    SET PARAMETER ID 'BES' FIELD v_ebeln.

    v_ebeln is in blank, the same as the v_mat

    you need to select the record and then assing those values, maybe that's why it is not working.

    should be sth like this:

    READ TABLE final INDEX rs_selfield-tabindex.

    SET PARAMETER ID 'BES' FIELD final-ebeln.


    Regards

    Miguel

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Feb 22, 2014 at 07:00 AM

    Akshath,

    You also need to give MTART in your FM MATERIAL_BTCI_SELECTION_NEW.


    Like this:

    * Function module for finding the view number in MM02

    CALL FUNCTION 'MATERIAL_BTCI_SELECTION_NEW'

    EXPORTING

    material = w_final-matnr

    materialart = lv_mtart " MATERIAL TYPE (MTART)

    selection = 'E'

    tcode = 'MM02'

    TABLES

    btci_d0070 = lt_btci

    EXCEPTIONS

    material_not_found = 1

    material_number_missing = 2

    material_type_missing = 3

    material_type_not_found = 4

    no_active_dynpro_selected = 5

    no_authority = 6

    OTHERS = 7.

    READ TABLE lt_btci WITH KEY fval = 'X'.

    IF sy-subrc = 0.

    lv_cnt = lt_btci-fnam+17(2).

    CONCATENATE 'MSICHTAUSW-DYTXT' '(' lv_cnt ')' INTO l_dytxt.

    CONCATENATE 'MSICHTAUSW-KZSEL' '(' lv_cnt ')' INTO l_dytxt1.

    ENDIF.



    This will work for you.


    Vivek

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on May 28 at 04:41 AM

    Use below code to select specific view(s) by calling transaction MM43.

    * Basic

    SET PARAMETER ID 'MAT' FIELD L_MATNR.

    SET PARAMETER ID 'MXX' FIELD '0'. "Basic

    CALL TRANSACTION 'MM43' AND SKIP FIRST SCREEN.

    * Basic + Logistics: distribution center

    SET PARAMETER ID 'MAT' FIELD L_MATNR.

    SET PARAMETER ID 'VZW' FIELD L_DC.

    SET PARAMETER ID 'MXX' FIELD '05'. "Basic + Logistics: distribution center

    CALL TRANSACTION 'MM43' AND SKIP FIRST SCREEN.

    * Basic + Logistics: distribution center + Logistics: store

    SET PARAMETER ID 'MAT' FIELD L_MATNR.

    SET PARAMETER ID 'VZW' FIELD L_DC.

    SET PARAMETER ID 'WRK' FIELD L_STORE.

    SET PARAMETER ID 'MXX' FIELD '056'. "Basic + Logistics: distribution center + Logistics: store

    CALL TRANSACTION 'MM43' AND SKIP FIRST SCREEN.

    The main point is value of 'MXX' as listed below.

    * 0 Basic data
    * 1 Listing
    * 2 Classification
    * 3 Purchasing
    * 4 Sales
    * 5 Logistics: distribution center
    * 6 Logistics: store
    * 7 POS
    * 8 Allocation table

    So, if you want to pre-select Listing + Logistics: store views, use SET PARAMETER ID 'MXX' FIELD '16'.

    One more note, if you use function 'MATERIAL_MAINTAIN_DIAL_RETAIL', value of P_PSTAT uses same value as 'MXX'.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.