FuBa: DYNP_VALUES_READMarkusW hat geschrieben:Gibt es ne Möglichkeit zum Zeitpunkt POV den Inhalt eines Table-Controls auszulesen??? (um z.b. in einer internen Tabelle zu speichern)
Ne will schon das komplette TC auslesen. den genannten FuBa hab ich schon gefunden, gibt aber keine Werte zurück...deshalb hab ich den nicht erwähnt.JHM hat geschrieben:FuBa: DYNP_VALUES_READMarkusW hat geschrieben:Gibt es ne Möglichkeit zum Zeitpunkt POV den Inhalt eines Table-Controls auszulesen??? (um z.b. in einer internen Tabelle zu speichern)
Wenn du nur die aktuelle Zeile bestimmen willst FuBa: DYNP_GET_STEPL
Code: Alles auswählen.
DATA: lt_test TYPE TABLE OF dynpread.
lf_sycprog = sy-cprog.
lf_sydynnr = sy-dynnr.
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
dyname = lf_sycprog
dynumb = lf_sydynnr
* TRANSLATE_TO_UPPER = ' '
* REQUEST = ' '
* PERFORM_CONVERSION_EXITS = ' '
* PERFORM_INPUT_CONVERSION = ' '
* DETERMINE_LOOP_INDEX = ' '
TABLES
dynpfields = lt_test
* EXCEPTIONS
* INVALID_ABAPWORKAREA = 1
* INVALID_DYNPROFIELD = 2
* INVALID_DYNPRONAME = 3
* INVALID_DYNPRONUMMER = 4
* INVALID_REQUEST = 5
* NO_FIELDDESCRIPTION = 6
* INVALID_PARAMETER = 7
* UNDEFIND_ERROR = 8
* DOUBLE_CONVERSION = 9
* STEPL_NOT_FOUND = 10
* OTHERS = 11
.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Code: Alles auswählen.
DATA: lt_test TYPE TABLE OF dynpread,
ls_test LIKE LINE OF lt_test.
MOVE 'GS_MCDON-MCDONPR' TO ls_test-fieldname.
APPEND ls_test TO lt_test.
Code: Alles auswählen.
MODULE create_f4_wertehilfe INPUT.
* Eigene Datenstruktur
TYPES: BEGIN OF ls_mcd_line,
mcdonpr TYPE /xxxx/mcdonpr,
mcdontx TYPE char80s,
END OF ls_mcd_line.
DATA: lt_mcdon_tab TYPE STANDARD TABLE OF ls_mcd_line.
DATA: lt_ret_tab TYPE STANDARD TABLE OF ddshretval,
ls_ret_tab LIKE LINE OF lt_ret_tab.
DATA: lt_test TYPE TABLE OF dynpread,
ls_test LIKE LINE OF lt_test.
DATA: lf_sycprog LIKE sy-cprog,
lf_sydynnr LIKE sy-dynnr.
DATA: h_feld TYPE /xxxx/mcdonpr,
lf_merk TYPE c,
lf_zaehl TYPE i VALUE 1.
CLEAR gt_mcd_seltab.
lf_sycprog = sy-cprog.
lf_sydynnr = sy-dynnr.
IF lf_merk = ' '.
MOVE 'GS_MCDON-MCDONPR' TO ls_test-fieldname.
APPEND ls_test TO lt_test.
lf_merk = 'X'.
ENDIF.
DO 13 TIMES.
MOVE lf_zaehl TO ls_test-stepl.
MODIFY TABLE lt_test FROM ls_test .
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
dyname = lf_sycprog
dynumb = lf_sydynnr
translate_to_upper = 'X'
TABLES
dynpfields = lt_test.
READ TABLE lt_test INTO ls_test INDEX 1.
IF NOT ls_test-fieldvalue IS INITIAL.
MOVE 'E' TO gs_mcd_seltab-sign.
MOVE 'EQ' TO gs_mcd_seltab-option.
MOVE ls_test-fieldvalue TO gs_mcd_seltab-low.
APPEND gs_mcd_seltab TO gt_mcd_seltab.
ENDIF.
lf_zaehl = lf_zaehl + 1.
ENDDO.
lf_zaehl = 1.
SELECT t~mcdonpr b~mcdontx
FROM /xxxx/tmcdo AS t
INNER JOIN /xxxx/bmcdo AS b
ON t~mcdonpr = b~mcdonpr
INTO CORRESPONDING FIELDS OF TABLE lt_mcdon_tab
WHERE b~spras = sy-langu
AND t~mcdonpr IN gt_mcd_seltab.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'MCDONPR'
dynpprog = lf_sycprog
dynpnr = lf_sydynnr
dynprofield = 'mcdonpr' "bis jetzt,egal was drin steht
value_org = 'S'
TABLES
value_tab = lt_mcdon_tab
return_tab = lt_ret_tab .
ENDMODULE. " create_f4_wertehilfe INPUT
Code: Alles auswählen.
determine_loop_index = 'X'
Code: Alles auswählen.
AND t~mcdonpr IN gt_mcd_seltab.
Code: Alles auswählen.
CLEAR gt_mcd_seltab.
lf_sycprog = sy-cprog.
lf_sydynnr = sy-dynnr.
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
dyname = lf_sycprog
dynumb = lf_sydynnr
translate_to_upper = 'X'
request = 'A'
TABLES
dynpfields = lt_test
EXCEPTIONS
invalid_dynprofield = 2
OTHERS = 11.
IF sy-subrc = 2.
* MESSAGE s000 WITH 'Dynprofeld nicht vorhanden.'.
EXIT.
ELSEIF sy-subrc <> 0.
MESSAGE x000 WITH 'Nicht nachvollziehbarer Fehler.'.
ENDIF.
LOOP AT lt_test INTO ls_test.
IF ls_test-fieldname = 'GS_MCDON-MCDONPR'.
IF NOT ls_test-fieldvalue IS INITIAL.
MOVE 'E' TO gs_mcd_seltab-sign.
MOVE 'EQ' TO gs_mcd_seltab-option.
MOVE ls_test-fieldvalue TO gs_mcd_seltab-low.
APPEND gs_mcd_seltab TO gt_mcd_seltab.
ENDIF.
ENDIF.
ENDLOOP.