2018 Dec 15 11:56 AM
Hi
i want add a new sub menu in edit menu for VI01 t code with name "search" that with it can be searched in items like "position" function .
but i do not know how to do it.
Someone has this experience
please guide me
thanks
2019 Jan 16 10:06 AM
best way is add toolbar in shipment cost transaction . and solution is in below. may be useful for abap developers.
this functionality is useful for BDC (Batch Data Communication) , when call transaction "vi01" or "vi02" for create or edit shipment cost , when There are a lot of items
best regards
...
1_in SE80 Tcode , make a copy of “A30” GUI-STATUS
2_in SE41 Tcode , add new application toolbar for copied GUI-STATUS (ZA30)
3_ in SE80 Tcode , at end of “FORM cua_set “ Add new enhancement for change PF-STATUS with new
ENHANCEMENT 2 ZMV54AF0C_PFSTATUS. "active version
if sy-cprog EQ 'SAPMV54A' and
sy-dynnr eq '0030' and
fcode is not INITIAL and
( sy-tcode eq 'VI01' or sy-tcode eq 'VI02' or sy-tcode eq 'VI03' ) .
SET PF-STATUS 'ZA30' OF PROGRAM 'ZSAPMV54A' EXCLUDING cua_exclude.
"RETURN.
endif.
ENDENHANCEMENT.
4_ in SE80 Tcode , at first of “FORM fcode_processing “ add new enhancement for search item code
ENHANCEMENT 1 ZEI_MV54AF0F_POSI. "active version
if SY-UCOMM eq 'POSI'.
DATA IT_FIELDS TYPE STANDARD TABLE OF SVAL WITH HEADER LINE.
data: RETURNCODE type RETURNCODE.
data: xMax_Fkpos type vfkp-fkpos.
data: xTOP_LINE type VFKP-FKPOS.
*select max( FKPOS )
*into xMax_Fkpos
*from VFKP
*where FKNUM eq VFKP-FKNUM.
xMax_Fkpos = VFKP-FKPOS.
CLEAR: IT_FIELDS.
IT_FIELDS-TABNAME = 'VFKP'.
IT_FIELDS-FIELDNAME = 'FKPOS'.
IT_FIELDS-FIELD_ATTR = ' '.
IT_FIELDS-FIELD_OBL = 'X'.
APPEND IT_FIELDS.
CALL FUNCTION 'POPUP_GET_VALUES'
EXPORTING
NO_VALUE_CHECK = 'X'
POPUP_TITLE = 'Choose Value for Search in item'
START_COLUMN = '5'
START_ROW = '5'
IMPORTING
RETURNCODE = RETURNCODE
TABLES
FIELDS = IT_FIELDS
EXCEPTIONS
ERROR_IN_FIELDS = 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.
IF xMax_Fkpos is initial.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
IF RETURNCODE = ' '.
if IT_FIELDS-VALUE gt xMax_Fkpos.
xTOP_LINE = xMax_Fkpos.
else.
xTOP_LINE = IT_FIELDS-VALUE.
endif.
if IT_FIELDS-VALUE le 0 .
xTOP_LINE = 1 .
endif.
CRTL_ITEMS_VFKP-TOP_LINE = xTOP_LINE.
""V_CURR_LINE = sy-tabix.
""V_TOT_LINE = tablecontrol-lines.
REFRESH IT_FIELDS.
CLEAR RETURNCODE.
clear: xMax_Fkpos , xTOP_LINE , SY-UCOMM .
SY-UCOMM = 'KRMA'.
fcode = 'KRMA'.
RETURN.
ENDIF.
endif.
ENDENHANCEMENT.
5_In VI01 , VI02 , VI03 Tcodes , we can use the new toolbar (Position Of Item)
.
2018 Dec 17 7:20 AM
Hello
You can try using implicit as done here for VL02 but looks quite risky. In this blog approach OP has copied the program as well as PF status then called it in an implicit enhancement in PBO and later handle in PAI.
Thanks
Nabheet
2018 Dec 17 11:02 AM
Hello Nabheet
Thank you. The topics are very general
I did not understand the solution
best regards
2018 Dec 29 2:57 PM
i want add or show position button in vi01 , vi02 , vi03 tcode as illustrate
2019 Jan 16 10:06 AM
best way is add toolbar in shipment cost transaction . and solution is in below. may be useful for abap developers.
this functionality is useful for BDC (Batch Data Communication) , when call transaction "vi01" or "vi02" for create or edit shipment cost , when There are a lot of items
best regards
...
1_in SE80 Tcode , make a copy of “A30” GUI-STATUS
2_in SE41 Tcode , add new application toolbar for copied GUI-STATUS (ZA30)
3_ in SE80 Tcode , at end of “FORM cua_set “ Add new enhancement for change PF-STATUS with new
ENHANCEMENT 2 ZMV54AF0C_PFSTATUS. "active version
if sy-cprog EQ 'SAPMV54A' and
sy-dynnr eq '0030' and
fcode is not INITIAL and
( sy-tcode eq 'VI01' or sy-tcode eq 'VI02' or sy-tcode eq 'VI03' ) .
SET PF-STATUS 'ZA30' OF PROGRAM 'ZSAPMV54A' EXCLUDING cua_exclude.
"RETURN.
endif.
ENDENHANCEMENT.
4_ in SE80 Tcode , at first of “FORM fcode_processing “ add new enhancement for search item code
ENHANCEMENT 1 ZEI_MV54AF0F_POSI. "active version
if SY-UCOMM eq 'POSI'.
DATA IT_FIELDS TYPE STANDARD TABLE OF SVAL WITH HEADER LINE.
data: RETURNCODE type RETURNCODE.
data: xMax_Fkpos type vfkp-fkpos.
data: xTOP_LINE type VFKP-FKPOS.
*select max( FKPOS )
*into xMax_Fkpos
*from VFKP
*where FKNUM eq VFKP-FKNUM.
xMax_Fkpos = VFKP-FKPOS.
CLEAR: IT_FIELDS.
IT_FIELDS-TABNAME = 'VFKP'.
IT_FIELDS-FIELDNAME = 'FKPOS'.
IT_FIELDS-FIELD_ATTR = ' '.
IT_FIELDS-FIELD_OBL = 'X'.
APPEND IT_FIELDS.
CALL FUNCTION 'POPUP_GET_VALUES'
EXPORTING
NO_VALUE_CHECK = 'X'
POPUP_TITLE = 'Choose Value for Search in item'
START_COLUMN = '5'
START_ROW = '5'
IMPORTING
RETURNCODE = RETURNCODE
TABLES
FIELDS = IT_FIELDS
EXCEPTIONS
ERROR_IN_FIELDS = 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.
IF xMax_Fkpos is initial.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
IF RETURNCODE = ' '.
if IT_FIELDS-VALUE gt xMax_Fkpos.
xTOP_LINE = xMax_Fkpos.
else.
xTOP_LINE = IT_FIELDS-VALUE.
endif.
if IT_FIELDS-VALUE le 0 .
xTOP_LINE = 1 .
endif.
CRTL_ITEMS_VFKP-TOP_LINE = xTOP_LINE.
""V_CURR_LINE = sy-tabix.
""V_TOT_LINE = tablecontrol-lines.
REFRESH IT_FIELDS.
CLEAR RETURNCODE.
clear: xMax_Fkpos , xTOP_LINE , SY-UCOMM .
SY-UCOMM = 'KRMA'.
fcode = 'KRMA'.
RETURN.
ENDIF.
endif.
ENDENHANCEMENT.
5_In VI01 , VI02 , VI03 Tcodes , we can use the new toolbar (Position Of Item)
.
2019 Nov 14 2:36 PM