Registration

Dear SAP Community Member,
In order to fully benefit from what the SAP Community has to offer, please register at:
http://scn.sap.com
Thank you,
The SAP Community team.
Skip to end of metadata
Go to start of metadata

Report dynamic_select. 

TYPES BEGIN OF ty_where,
        where(30TYPE c,
  END OF ty_where,
  BEGIN OF ty_mara,
    matnr TYPE matnr,
    MBRSH TYPE mbrsh,
    END OF ty_mara.


DATA :  wa_where TYPE ty_where,
              it_mara type STANDARD TABLE OF ty_mara,
              wa_mara TYPE ty_mara.

PARAMETERS p_matnr TYPE matnr.

if p_matnr is INITIAL.
CONCATENATE 'matnr =' '''' into wa_where SEPARATED BY space.
CONCATENATE wa_where  '000000000000000023' '''' INTO wa_where.
ELSE.
CALL FUNCTION 'CONVERSION_EXIT_MATN1_INPUT'
  EXPORTING
    input              p_matnr
 IMPORTING
   OUTPUT             p_matnr
 EXCEPTIONS
   LENGTH_ERROR       1
   OTHERS             2.
IF sy-subrc <> 0.
* Implement suitable error handling here
ENDIF.
CONCATENATE 'matnr =' '''' into wa_where SEPARATED BY space.
CONCATENATE wa_where  p_matnr '''' INTO wa_where.
ENDIF.

 
  SELECT matnr MBRSH from mara into TABLE it_mara WHERE (wa_where).
    
    

 

  • No labels