Adding Pictures Material Master Data

DISPLAYING MATERIAL MASTER DATA JPG IMAGES

TCODE: OMT3B CHOSE ONE SECTION AND SAPLMGD1 –> ZZ2 THEN CREATE THIS REPORT

YOU SHOUL PLACE A CUSTOM CONTAINER NAMED : C100 IN YOUR SUBSCREEN (001 ).

*&———————————————————————*
*& Report ZZ2
*&
*&———————————————————————*
*&
*&
*&———————————————————————*

REPORT ZZ2.

TABLES: MARA, MAKT, T130M .

DATA : CONTAINER TYPE REF TO CL_GUI_CUSTOM_CONTAINER.
DATA : DOCUMENT TYPE REF TO CL_DD_DOCUMENT.
DATA : RENK(10) TYPE C .

PARAMETERS: P_MATNR LIKE MARA-MATNR.

START-OF-SELECTION.
SELECT SINGLE * FROM MARA WHERE MATNR = P_MATNR.

CALL SCREEN 001.
*&———————————————————————*
*& Module STATUS_0001 OUTPUT
*&———————————————————————*
MODULE STATUS_0001 OUTPUT.
DATA V_ID TYPE SDYDO_KEY.
DATA V_MAKTX TYPE SDYDO_TEXT_ELEMENT.
DATA V_WIDTH TYPE STRING VALUE ‘450’.

CREATE OBJECT CONTAINER
EXPORTING
CONTAINER_NAME = ‘C100’.

CREATE OBJECT DOCUMENT.

V_ID = MARA-MATNR.
V_MAKTX = MAKT-MAKTX.

CALL METHOD DOCUMENT->ADD_TEXT
EXPORTING
TEXT = V_MAKTX.

CALL METHOD DOCUMENT->ADD_PICTURE
EXPORTING
PICTURE_ID = V_ID
WIDTH = V_WIDTH.

CALL METHOD DOCUMENT->DISPLAY_DOCUMENT
EXPORTING
PARENT = CONTAINER.

IF T130M-AKTYP = ‘A’ .
LOOP AT SCREEN .
IF SCREEN-NAME = ‘MARA-RENK’ .
SCREEN-INPUT = 0 .
MODIFY SCREEN .
ENDIF .
ENDLOOP .
ENDIF .

ENDMODULE. ” STATUS_0001 OUTPUT
*&———————————————————————*
*& Module exit INPUT
*&———————————————————————*
* text
*———————————————————————-*
MODULE EXIT INPUT.

LEAVE TO SCREEN 0.

ENDMODULE. ” exit INPUT

*&———————————————————————*
*& Module f4_renk INPUT
*&———————————————————————*
* text
*———————————————————————-*
MODULE F4_RENK INPUT.

PERFORM RENK_GET_VALUES USING ‘MARA-RENK’.

ENDMODULE. ” f4_renk INPUT

*&———————————————————————*
*& Form RENK_GET_VALUES
*&———————————————————————*
* text
*———————————————————————-*
* –>P_0085 text
*———————————————————————-*
FORM RENK_GET_VALUES USING P_RENK .

ENDFORM. ” RENK_GET_VALUES

*&———————————————————————*
*& Form RENK_GET_F4HELP
*&———————————————————————*
FORM RENK_GET_F4HELP USING P_DYNPFIELDS_FIELDINP
P_DYNPFIELDS_FIELDVAL
CHANGING P_RENK_VAL .

ENDFORM. ” RENK_GET_F4HELP

*&———————————————————————*
*& Module USER_COMMAND_0001 INPUT
*&———————————————————————*
* text
*———————————————————————-*
MODULE USER_COMMAND_0001 INPUT.
*ptab
*RMMG1

CALL FUNCTION ‘MARA_SET_SUB’
EXPORTING
WMARA = MARA.

ENDMODULE. ” USER_COMMAND_0001 INPUT

0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply