1. 첫번째 질문은 alv에 관한 질문인데요
-------------------------------
ㅣ 필드1 ㅣ 필드 2 ㅣ 필드 3 ㅣ
-------------------------------
1 ㅣ ㅣ ㅣ ㅣ
-------------------------------
2 ㅣ ㅣ ㅣ ㅣ
-------------------------------
3 ㅣ ㅣ ㅣ ㅣ
-------------------------------
이런 레포트에서 [필드 3]에 파서블 엔트리를 주려고 합니다.
그때 [필드 1]의 값에 따라서 파서블 엔트리 내용을 다르게 주고 싶어서요. 가능한가요?
가능하다면 어떻게 해야 할까요?ㅠ
2. 두번째 질문은 table control에서요.
[고정자산마스터 생성] <----푸쉬버튼
---------------------------------
ㅣ 고정자산 ㅣ 필드 2 ㅣ 필드 3 ㅣ
---------------------------------
1 ㅣ ㅣ ㅣ ㅣ
---------------------------------
2 ㅣ ㅣ ㅣ ㅣ
---------------------------------
3 ㅣ ㅣ ㅣ ㅣ
----------------------------------
고정자산 마스터 생성 버튼을 눌러서 생성을 마치고 나면 만들어진 자산번호를 아래 고정자산 필드에
넣어주고 싶은데요. 어떻게 해야 하는걸까요?ㅠ
도움 부탁드립니다.. ㅠㅠ 몇일동안 생각을 해보고 이것저것 해봐도 모르겠더라구요..
하단부의 READ_SCREEN_FIELD 부분 이용해서 파서블 엔트리 만드시면 됩니다.
*&---------------------------------------------------------------------*
*& Form FILL_ARBPL_F4
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
FORM FILL_ARBPL_F4 USING P_ARBPL.
"스크린 FIELD값 읽기
PERFORM READ_SCREEN_FIELD USING SY-CPROG
SY-DYNNR
'S_WERKS-LOW'
S_WERKS-LOW.
DATA : BEGIN OF LT_ARBPL OCCURS 0,
WERKS LIKE M_CRAMN-WERKS,
ARBPL LIKE M_CRAMN-ARBPL,
KTEXT LIKE M_CRAMN-KTEXT,
END OF LT_ARBPL.
DATA : L_TITLE(50).
CLEAR : G_SELECTFIELD, GT_FIELDS, G_SELECT_VALUE, G_TABIX.
REFRESH : GT_FIELDS.
DATA : L_WRK(5).
L_WRK = S_WERKS-LOW.
SELECT DISTINCT WERKS ARBPL KTEXT
INTO CORRESPONDING FIELDS OF TABLE LT_ARBPL
FROM M_CRAMN
WHERE WERKS LIKE L_WRK.
DESCRIBE TABLE LT_ARBPL LINES G_CNT.
SORT LT_ARBPL BY WERKS ARBPL.
DELETE ADJACENT DUPLICATES FROM LT_ARBPL.
GT_FIELDS-TABNAME = 'M_CRAMN'.
GT_FIELDS-FIELDNAME = 'WERKS'.
GT_FIELDS-SELECTFLAG = ' '.
APPEND GT_FIELDS.
GT_FIELDS-TABNAME = 'M_CRAMN'.
GT_FIELDS-FIELDNAME = 'ARBPL'.
GT_FIELDS-SELECTFLAG = 'X'.
APPEND GT_FIELDS.
GT_FIELDS-TABNAME = 'M_CRAMN'.
GT_FIELDS-FIELDNAME = 'KTEXT'.
GT_FIELDS-SELECTFLAG = ' '.
APPEND GT_FIELDS.
DESCRIBE TABLE LT_ARBPL LINES G_CNT.
IF G_CNT = 1.
READ TABLE LT_ARBPL INDEX 1.
P_ARBPL = LT_ARBPL-ARBPL. "SELECT_VALUE.
ELSE.
CALL FUNCTION 'HELP_VALUES_GET_NO_DD_NAME'
EXPORTING
CUCOL = 20
CUROW = 05
SELECTFIELD = G_SELECTFIELD
TITEL = L_TITLE
IMPORTING
IND = G_TABIX
SELECT_VALUE = G_SELECT_VALUE
TABLES
FIELDS = GT_FIELDS
FULL_TABLE = LT_ARBPL
EXCEPTIONS
FULL_TABLE_EMPTY = 1
NO_TABLESTRUCTURE_GIVEN = 2
NO_TABLEFIELDS_IN_DICTIONARY = 3
MORE_THEN_ONE_SELECTFIELD = 4
NO_SELECTFIELD = 5
OTHERS = 6.
CHECK NOT G_TABIX IS INITIAL.
READ TABLE LT_ARBPL INDEX G_TABIX.
P_ARBPL = LT_ARBPL-ARBPL.
ENDIF.
ENDFORM. " FILL_ARBPL_F4
*&---------------------------------------------------------------------*
*& Form READ_SCREEN_FIELD
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
FORM READ_SCREEN_FIELD USING P_PROG
P_DYNNR
P_FIELD
P_VALUE.
DATA : LT_FIELDS LIKE DYNPREAD OCCURS 0 WITH HEADER LINE.
LT_FIELDS-FIELDNAME = P_FIELD.
APPEND LT_FIELDS.
"현재 화면의 특정 필드 값 읽기
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
DYNAME = P_PROG
DYNUMB = P_DYNNR
TABLES
DYNPFIELDS = LT_FIELDS
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 'S' NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ELSE.
READ TABLE LT_FIELDS INDEX 1.
MOVE LT_FIELDS-FIELDVALUE TO P_VALUE .
ENDIF.
ENDFORM. " READ_SCREEN_FIELD