Pushbutton obligatory
HI
We have a pushbutton in selection screen. We need to make that an mandatory field.
Please help.
Thanks in advance.
SS
Hi,
If that's your requirement, what you could do is, Check if your SY-UCOMM value is the function code of the button that you pressed and not any other event. Also, adding to this functionality, if you want to press only button2 and not any other after an event like clicking button1, then you can store the SY-UCOMM value of the button1 in OK_CODE and then check if the OK_CODE is 'but1' and SY-UCOMM eq 'but2' and proceed accordingly.
Display an information message asking the user to click on the button before proceeding.
if sy-ucomm ne 'but1'
"display error message
else.
"Go ahead with your logic
endif.
Similar Messages
-
Pushbutton Text does not display in portal but display in development
Hi Experts,
I ceated Pushbutton in selection screen block . Pushbutton text is does't display in portal view but display
in development .
i attached my coding , could you suggest anyother coding to diplay the pushbutton text.
SELECTION-SCREEN BEGIN OF BLOCK auth WITH FRAME TITLE text-003.
PARAMETER p_sig(40) TYPE c." OBLIGATORY.
SELECTION-SCREEN SKIP 1.
SELECTION-SCREEN PUSHBUTTON /43(20) execu USER-COMMAND printlayout ." VISIBLE LENGTH 15.
SELECTION-SCREEN END OF BLOCK auth.
INITIALIZATION.
MOVE text-004 TO execu.Did you check in your portal instance that TEXT-004 has the value you want?
-
Obligatory Paramater Not Always
Hi,
I have a parameter that is obligatory and I have a button that calls another transaction. The
problem is that when I want to go to the other transaction by clicking on the button it asked
for the obligatory parameter first. But I need that parameter be obligatory.
If I remove the OBLIGATORY property and validate it myself, the icon of the arrow in the
input field its gone. How can I do it with the OBLIGATORY thing.
The code is like this:
SELECTION-SCREEN: PUSHBUTTON 1(10) TEXT-001 USER-COMMAND FC01.
PARAMETERS: P_VAR(2) TYPE C OBLIGATORY.
AT SELECTION-SCREEN.
CASE SY-UCOMM.
WHEN 'FC01'.
CALL TRANSACTION 'ZABCDE'.
ENDCASE.
Regards,
Isaac Melendezhello, try this..
1.- remove the OBLIGATORY property .
put in the program :
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
CASE screen-name.
WHEN 'p_name'. your parameter
screen-required = '1'.
MODIFY SCREEN.
ENDCASE.
ENDLOOP.
you'll have validate the obligatory data in the start-of-selection or any other event.
IF p_name IS INITIAL.
MESSAGE 'obligatory data'.
endif -
How can I add a pushbutton inside ALV toolbar?
Hi,
This can be included into ALV by defining a GUI and setting that GUI using Set PF Status.
Check the below code for the same,
REPORT ZSPRENH069 NO STANDARD PAGE HEADING.
TYPE-POOLS : SLIS. "Global Type for ALV
T Y P E S *
TYPES:
BEGIN OF TY_VB_AKAP,
VBELN TYPE VBELN_VA, "Sales Document
KUNNR TYPE KUNAG, "Sold-to party
POSNR TYPE POSNR_VA, "Item Number
MATNR TYPE MATNR, "Material Number
PMATN TYPE PMATN, "Pricing Reference Material/Newly Created Material
KWMENG TYPE KWMENG, "Cumulative Order Qty. in Sales Units
VRKME TYPE VRKME, "Sales Unit
NETPR TYPE NETPR, "Net Price
KZWI1 TYPE KZWI1, "Sub Total 1 from pricing procedure for condition
VKAUS TYPE ABRVW, "Usage Indicator
END OF TY_VB_AKAP,
BEGIN OF TY_MARA,
MATNR TYPE MATNR, "Material Number
ZZTECHSPEC TYPE ZTECHSPEC, "Technical Specification
END OF TY_MARA,
BEGIN OF TY_MVKE,
MATNR TYPE MATNR, "Material Number
VKORG TYPE VKORG, "Sales Organization
VTWEG TYPE VTWEG, "Distribution Channel
KONDM TYPE KONDM, "Material Pricing Group
END OF TY_MVKE,
BEGIN OF TY_VBKD,
VBELN TYPE VBELN_VA, "Sales Document
POSNR TYPE POSNR_VA, "Item Number
BSTKD_E TYPE BSTKD_E, "Used to capture New Material Number
END OF TY_VBKD,
BEGIN OF TY_IHEADER,
SELECT(1) TYPE C, "Check Box
VBELN TYPE VBELN, "Sales Document
KUNNR TYPE KUNAG, "Sold-to Party
END OF TY_IHEADER,
BEGIN OF TY_MESSAGE1,
VKORG TYPE VKORG, "Sales Organization
VTWEG TYPE VTWEG, "Distribution Channel
KUNNR TYPE KUNAG, "Customer number
KONDM TYPE KONDM, "Material pricing group
ZCOUNT(2) TYPE N, "Zcount
MSGTYP(1) TYPE C, "Message type
TEXT(150) TYPE C, "Message text
END OF TY_MESSAGE1,
BEGIN OF TY_MESSAGE2,
VKORG TYPE VKORG, "Sales Organization
VTWEG TYPE VTWEG, "Distribution Channel
KUNNR TYPE KUNAG, "Customer number
MATNR TYPE MATNR, "Material Number
MSGTYP(1) TYPE C, "Message type
TEXT(150) TYPE C, "Message text
END OF TY_MESSAGE2,
BEGIN OF TY_IFINAL,
VBELN TYPE VBELN_VA, "Sales Document
KWMENG TYPE KWMENG, "Cumulative Order Qty. in Sales Units
POSNR TYPE POSNR_VA, "Item Number
KUNNR TYPE KUNAG, "Sold-to party
MATNR TYPE MATNR, "Material Number
VRKME TYPE VRKME, "Sales Unit
KZWI1 TYPE KZWI1, "Sub Total 1 from pricing procedure for condition
VKAUS TYPE ABRVW, "Usage Indicator
ZZTECHSPEC TYPE ZTECHSPEC, "Technical Specification
PMATN TYPE PMATN, "Pricing Reference Material/Newly Created Material
KONDM TYPE KONDM, "Material Pricing Group
END OF TY_IFINAL,
BEGIN OF TY_ACC1,
VBELN TYPE VBELN_VA, "Sales Document
KUNNR TYPE KUNAG, "Sold-to party
KONDM TYPE KONDM, "Material Pricing Group
ZCOUNT(2) TYPE N, "ZCount indicator
KSTBM TYPE KSTBM, "Quantity
VRKME TYPE VRKME, "Sales Unit
ZZTECHSPEC TYPE ZTECHSPEC, "Technical Specification
KZWI1 TYPE KZWI1, "Sub Total 1 from pricing procedure for condition
ERROR(1) TYPE N, "Error Field
END OF TY_ACC1,
BEGIN OF TY_ACC2,
VBELN TYPE VBELN_VA, "Sales Document
KUNNR TYPE KUNAG, "Sold-to party
MATNR TYPE MATNR, "Material Number
KSTBM TYPE KSTBM, "Cumulative Order Qty. in Sales Units
ZZTECHSPEC TYPE ZTECHSPEC, "Technical Specification
VRKME TYPE VRKME, "Sales Unit
KZWI1 TYPE KZWI1, "Sub Total 1 from pricing procedure for condition
ERROR(1) TYPE N, "Error field
END OF TY_ACC2.
D A T A *
Internal Table Declarations
DATA: T_FIELDCATALOG TYPE SLIS_T_FIELDCAT_ALV, "Fieldcatalog IT
T_EVENTS TYPE SLIS_T_EVENT, "Event IT
T_HEADER TYPE SLIS_T_LISTHEADER, "Header IT
T_VB_AKAP TYPE STANDARD TABLE OF TY_VB_AKAP, "To hold records from VBAK & VBAP Table
T_MARA TYPE STANDARD TABLE OF TY_MARA, "To hold records from MARA Table
T_MVKE TYPE STANDARD TABLE OF TY_MVKE, "To hold records from MVKE Table
T_VBKD TYPE STANDARD TABLE OF TY_VBKD, "To hold records from VBKD Table
T_IHEADER TYPE STANDARD TABLE OF TY_IHEADER, "To hold records from VBAK Table
T_IFINAL TYPE STANDARD TABLE OF TY_IFINAL, "To hold cumulative data for ALV
T_BDCDATA TYPE STANDARD TABLE OF BDCDATA, "IT for bdcdata
T_BDCMSGCOLL TYPE STANDARD TABLE OF BDCMSGCOLL, "IT for error messages
T_MESSAGE1 TYPE STANDARD TABLE OF TY_MESSAGE1, "IT for conditions1 messages
T_MESSAGE2 TYPE STANDARD TABLE OF TY_MESSAGE2, "IT for conditions2 messages
T_ACC2 TYPE STANDARD TABLE OF TY_ACC2, "IT for holding data for Second Access Sequence Processing
T_ACC1 TYPE STANDARD TABLE OF TY_ACC1, "IT for holding data for First Access Sequence Processing
T_SELECT TYPE STANDARD TABLE OF RSPARAMS, "IT for holding data related to the selection screen
Work area Declarations
W_FIELDCATALOG TYPE SLIS_FIELDCAT_ALV, "Fieldcatalog WA
W_EVENT TYPE SLIS_ALV_EVENT, "Event WA
W_HEADER TYPE SLIS_LISTHEADER, "Header WA
W_LAYOUT TYPE SLIS_LAYOUT_ALV, "Layout WA
W_KEYINFO TYPE SLIS_KEYINFO_ALV, "Key Information WA
W_VB_AKAP TYPE TY_VB_AKAP, "To hold records from T_VB_AKAP
W_MARA TYPE TY_MARA, "To hold records from T_MARA
W_MVKE TYPE TY_MVKE, "To hold records from T_MVKE
W_VBKD TYPE TY_VBKD, "To hold records from T_VBKD
W_IHEADER TYPE TY_IHEADER, "To hold records from T_IHEADER
W_IFINAL TYPE TY_IFINAL, "To hold records from T_IFINAL
W_PARAMS TYPE CTU_PARAMS, "CTU Params
W_BDCDATA TYPE BDCDATA, "Work Area for BDCDATA
W_BDCMSGCOLL TYPE BDCMSGCOLL, "Work Area to collect BDC Messages
W_MESSAGE1 TYPE TY_MESSAGE1, "WA for price conditions1 messages
W_MESSAGE2 TYPE TY_MESSAGE2, "WA for price conditions2 messages
W_ACC2 TYPE TY_ACC2, "WA for holding records from T_ACC2
W_ACC1 TYPE TY_ACC1, "WA for holding records from T_ACC1
Variable declarations
G_AUDAT TYPE AUDAT, "Document Date (Date Received/Sent)
G_VBELN TYPE VBELN_VA, "Sales Document
G_KUNNR TYPE KUNAG, "Sold-to party
G_MATNR TYPE MATNR, "Material Number
G_REPID TYPE SY-REPID, "Program Name
G_MESSAGE(73) TYPE C, "To Capture Message
G_FLAG1(1) TYPE C, "Flag
G_ANSWER(1) TYPE C. "Optional Button
Constant declarations
CONSTANTS:
C_A(1) TYPE C VALUE 'A', "Constant Value A
C_S(1) TYPE C VALUE 'S', "Constant Value S
C_U(1) TYPE C VALUE 'U', "Constant Value U
C_X(1) TYPE C VALUE 'X', "Constant Value X
C_E(1) TYPE C VALUE 'E', "Constant Value E
C_I(1) TYPE C VALUE 'I', "Constant Value I
C_R(1) TYPE C VALUE 'R', "Constant Value R
C_B(1) TYPE C VALUE 'B', "Document Category is Quotation
C_HTNAME(10) TYPE C VALUE 'T_IHEADER', "Internal table for Header Data
C_ITNAME(10) TYPE C VALUE 'T_IFINAL', "Internal Table with processed data
C_Q2(2) TYPE C VALUE 'Q2', "Constant Order Reason Q2
C_100(3) TYPE C VALUE '100', "Popup screen
C_046(3) TYPE C VALUE '046', "Value 046
C_047(3) TYPE C VALUE '047', "Value 047
C_25(2) TYPE C VALUE '25', "Popup screen
C_5(1) TYPE C VALUE '5', "Popup screen
C_1 TYPE I VALUE 1, "Value 1 for Error Denotion
C_2 TYPE I VALUE 2, "Value 2 for Error Denotion
C_3 TYPE I VALUE 3, "Value 3 for BDC Error Denotion
C_1000(4) TYPE N VALUE 1000, "Value 1000
C_01(2) TYPE N VALUE '01', "Value 01 for Zcount
C_VK11(4) TYPE C VALUE 'VK11', "Transaction VK11
C_DYNBEGIN(1) TYPE C VALUE 'X', "Indicator
C_UPDATE(1) TYPE C VALUE 'S', "Update
C_DISMODE(1) TYPE C VALUE 'N', "Display
C_ZBPR(4) TYPE C VALUE 'ZBPR', "Condition Type ZBPR
C_ERROR(5) TYPE C VALUE 'ERROR'. "Error screen title
S E L E C T O P T I O N S & P A R A M E T E R S *
Selection-screen Block 1
SELECTION-SCREEN BEGIN OF BLOCK BLK1 WITH FRAME TITLE TEXT-001.
PARAMETERS: P_VKORG TYPE VKORG OBLIGATORY, "Sales Organization
P_VTWEG TYPE VTWEG OBLIGATORY, "Distribution Channel
P_SPART TYPE SPART DEFAULT '00'. "Division
SELECTION-SCREEN END OF BLOCK BLK1.
SELECTION-SCREEN BEGIN OF BLOCK BLK2 WITH FRAME TITLE TEXT-002.
SELECT-OPTIONS: S_AUDAT FOR G_AUDAT, "Document Date (Date Received/Sent)
S_VBELN FOR G_VBELN, "Sales Document
S_KUNNR FOR G_KUNNR, "Sold-to party
S_MATNR FOR G_MATNR. "Material Number
PARAMETERS: P_VKAUS(2) TYPE N. "Usage Indicator
SELECTION-SCREEN END OF BLOCK BLK2.
I N I T I A L I Z A T I O N *
INITIALIZATION.
CLEAR : G_REPID. "Program Name
G_REPID = SY-REPID. "Program Name
A T S E L E C T I O N S C R E E N *
AT SELECTION-SCREEN.
S T A R T O F S E L E C T I O N *
START-OF-SELECTION.
Data Selection
PERFORM DATA_RETRIEVAL.
Build Field Catalog
PERFORM BUILD_FIELDCATALOG.
Bulid layout
PERFORM BUILD_LAYOUT.
Build Events
PERFORM BUILD_EVENTS.
Captures the Values of Selection Screen
PERFORM CAPTURE_SCREEN.
E N D O F S E L E C T I O N *
END-OF-SELECTION.
Display List
PERFORM DISPLAY_ALV_REPORT.
F O R M S *
*& Form DATA_RETRIEVAL
Retrieves Data for ALV Display
FORM DATA_RETRIEVAL .
DATA : L_VKAUS TYPE VKAUS. "Variable to hold Usage Indicator
CLEAR L_VKAUS.
SELECT VBELN
KUNNR
INTO CORRESPONDING FIELDS OF TABLE T_IHEADER
FROM VBAK
WHERE VBELN IN S_VBELN
AND KUNNR IN S_KUNNR
AND VKORG EQ P_VKORG
AND AUDAT IN S_AUDAT
AND VTWEG EQ P_VTWEG
AND SPART EQ P_SPART
AND AUGRU EQ C_Q2
AND VBTYP EQ C_B.
IF NOT T_IHEADER IS INITIAL.
IF NOT P_VKAUS IS INITIAL OR P_VKAUS NE C_1.
CONCATENATE 'C' P_VKAUS INTO L_VKAUS.
SELECT A~VBELN
A~KUNNR
B~POSNR
B~MATNR
B~PMATN
B~KWMENG
B~VRKME
B~NETPR
B~KZWI1
B~VKAUS
INTO TABLE T_VB_AKAP
FROM VBAK AS A
JOIN VBAP AS B
ON A~VBELN EQ B~VBELN
FOR ALL ENTRIES IN T_IHEADER
WHERE A~VBELN EQ T_IHEADER-VBELN
AND B~MATNR IN S_MATNR
AND B~VKAUS EQ L_VKAUS.
ELSE.
SELECT A~VBELN
A~KUNNR
B~POSNR
B~MATNR
B~PMATN
B~KWMENG
B~VRKME
B~NETPR
B~KZWI1
B~VKAUS
INTO TABLE T_VB_AKAP
FROM VBAK AS A
JOIN VBAP AS B
ON A~VBELN EQ B~VBELN
FOR ALL ENTRIES IN T_IHEADER
WHERE A~VBELN EQ T_IHEADER-VBELN
AND B~MATNR IN S_MATNR.
ENDIF.
IF NOT T_VB_AKAP IS INITIAL.
SELECT VBELN
POSNR
BSTKD_E
INTO TABLE T_VBKD
FROM VBKD
FOR ALL ENTRIES IN T_VB_AKAP
WHERE VBELN EQ T_VB_AKAP-VBELN
AND POSNR EQ T_VB_AKAP-POSNR.
ENDIF.
SORT T_VBKD BY VBELN POSNR.
CLEAR W_VB_AKAP.
After much of coding was completed, Usage of PMATN was dropped and
the first eighteen characters of the field BSTKD was proposed for usage
Hence PMATN is overwritten by BSTKD value in the below loop
LOOP AT T_VB_AKAP INTO W_VB_AKAP.
CLEAR: W_VBKD,
W_VB_AKAP-PMATN.
READ TABLE T_VBKD INTO W_VBKD
WITH KEY VBELN = W_VB_AKAP-VBELN
POSNR = W_VB_AKAP-POSNR
BINARY SEARCH.
IF SY-SUBRC EQ 0.
W_VB_AKAP-PMATN = W_VBKD-BSTKD_E+0(18).
ENDIF.
MODIFY T_VB_AKAP FROM W_VB_AKAP TRANSPORTING PMATN.
CLEAR W_VB_AKAP.
ENDLOOP.
IF NOT T_VB_AKAP IS INITIAL.
SELECT MATNR
ZZTECHSPEC
INTO TABLE T_MARA
FROM MARA
FOR ALL ENTRIES IN T_VB_AKAP
WHERE MATNR EQ T_VB_AKAP-MATNR.
IF SY-SUBRC EQ 0.
SORT T_MARA BY MATNR.
ENDIF. "Checking SY-SUBRC for T_MARA
SELECT MATNR
ZZTECHSPEC
APPENDING TABLE T_MARA
FROM MARA
FOR ALL ENTRIES IN T_VB_AKAP
WHERE MATNR EQ T_VB_AKAP-PMATN.
IF SY-SUBRC EQ 0.
SORT T_MARA BY MATNR.
ENDIF. "Checking SY-SUBRC for T_MARA
SELECT MATNR
VKORG
VTWEG
KONDM
INTO TABLE T_MVKE
FROM MVKE
FOR ALL ENTRIES IN T_VB_AKAP
WHERE MATNR EQ T_VB_AKAP-PMATN.
IF SY-SUBRC EQ 0.
SORT T_MVKE BY MATNR VKORG VTWEG.
ENDIF. "Checking SY-SUBRC for T_MVKE
SELECT MATNR
VKORG
VTWEG
KONDM
APPENDING TABLE T_MVKE
FROM MVKE
FOR ALL ENTRIES IN T_VB_AKAP
WHERE MATNR EQ T_VB_AKAP-MATNR.
IF SY-SUBRC EQ 0.
SORT T_MVKE BY MATNR VKORG VTWEG.
ENDIF. "Checking SY-SUBRC for T_MVKE
ENDIF. " FOR T_VB_AKAP NOT INITIAL.
ENDIF. " FOR T_IHEADER NOT INITIAL.
CLEAR: W_VB_AKAP,
W_IFINAL.
LOOP AT T_VB_AKAP INTO W_VB_AKAP.
W_IFINAL-VBELN = W_VB_AKAP-VBELN.
W_IFINAL-KUNNR = W_VB_AKAP-KUNNR.
W_IFINAL-POSNR = W_VB_AKAP-POSNR.
W_IFINAL-MATNR = W_VB_AKAP-MATNR.
W_IFINAL-PMATN = W_VB_AKAP-PMATN.
W_IFINAL-KWMENG = W_VB_AKAP-KWMENG.
W_IFINAL-VRKME = W_VB_AKAP-VRKME.
W_IFINAL-NETPR = W_VB_AKAP-NETPR.
W_IFINAL-KZWI1 = ( W_VB_AKAP-KZWI1 / W_VB_AKAP-KWMENG ) * 1000.
W_IFINAL-VKAUS = W_VB_AKAP-VKAUS.
Populating Material Pricing Group from New Material Group, if such Group doesn't exist
Population of Material Pricing Group from Material Number is tried.
Similar condition does suit for Tech Spec too.
SORT: T_MVKE BY MATNR VKORG VTWEG,
T_MARA BY MATNR.
IF NOT W_VB_AKAP-PMATN IS INITIAL.
CLEAR W_MVKE.
READ TABLE T_MVKE
INTO W_MVKE
WITH KEY MATNR = W_VB_AKAP-PMATN
VKORG = P_VKORG
VTWEG = P_VTWEG
BINARY SEARCH.
IF SY-SUBRC EQ 0.
W_IFINAL-KONDM = W_MVKE-KONDM.
ENDIF.
READ TABLE T_MARA
INTO W_MARA
WITH KEY MATNR = W_VB_AKAP-PMATN
BINARY SEARCH.
IF SY-SUBRC EQ 0.
W_IFINAL-ZZTECHSPEC = W_MARA-ZZTECHSPEC.
ENDIF. " SY-SUBRC FOR READ TABLE T_MARA
IF W_MVKE-KONDM IS INITIAL.
ELSE.
SORT T_MVKE BY MATNR VKORG VTWEG.
CLEAR W_MVKE.
READ TABLE T_MVKE
INTO W_MVKE
WITH KEY MATNR = W_VB_AKAP-MATNR
VKORG = P_VKORG
VTWEG = P_VTWEG
BINARY SEARCH.
IF SY-SUBRC EQ 0.
W_IFINAL-KONDM = W_MVKE-KONDM.
ENDIF.
READ TABLE T_MARA
INTO W_MARA
WITH KEY MATNR = W_VB_AKAP-MATNR
BINARY SEARCH.
IF SY-SUBRC EQ 0.
W_IFINAL-ZZTECHSPEC = W_MARA-ZZTECHSPEC.
ENDIF. " SY-SUBRC FOR READ TABLE T_MARA
ELSE.
W_IFINAL-KONDM = W_MVKE-KONDM.
ENDIF. " IS INITIAL CHECK FOR W_MVKE-KONDM
APPEND W_IFINAL TO T_IFINAL.
CLEAR: W_VB_AKAP,
W_IFINAL.
ENDLOOP.
SORT T_IFINAL BY VBELN.
Checking whether if there are any header quotations which does not have items against them in item internal table
if such records exist then, ensuring that such records gets deleted from header too, so that inconsitency is removed.
CLEAR W_IHEADER.
LOOP AT T_IHEADER INTO W_IHEADER.
CLEAR W_IFINAL.
READ TABLE T_IFINAL INTO W_IFINAL WITH KEY VBELN = W_IHEADER-VBELN.
IF SY-SUBRC NE 0.
W_IHEADER-SELECT = C_X.
MODIFY T_IHEADER FROM W_IHEADER TRANSPORTING SELECT.
ENDIF.
ENDLOOP.
DELETE T_IHEADER WHERE SELECT = C_X.
SORT T_IFINAL BY VBELN.
ENDFORM. " DATA_RETRIEVAL
*& Form build_layout
To build ALV Layout
FORM BUILD_LAYOUT.
CLEAR : W_LAYOUT.
W_LAYOUT-COLWIDTH_OPTIMIZE = C_X.
W_LAYOUT-BOX_TABNAME = C_HTNAME. "tabname for checkbox
W_LAYOUT-BOX_FIELDNAME = 'SELECT'. "fieldname for checkbox
CLEAR : W_KEYINFO.
W_KEYINFO-HEADER01 = 'VBELN'. "Header1 key information
W_KEYINFO-ITEM01 = 'VBELN'. "Item1 key information
ENDFORM. "build_layout
*& Form build_events
To build ALV Events
FORM BUILD_EVENTS.
CONSTANTS: C_TOP_OF_PAGE TYPE SLIS_FORMNAME VALUE 'TOP_OF_PAGE'.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
I_LIST_TYPE = 1
IMPORTING
ET_EVENTS = T_EVENTS
EXCEPTIONS
LIST_TYPE_WRONG = 1
OTHERS = 2.
IF SY-SUBRC = 0.
READ TABLE T_EVENTS INTO W_EVENT
WITH KEY NAME = C_TOP_OF_PAGE.
IF SY-SUBRC = 0.
MOVE C_TOP_OF_PAGE TO W_EVENT-FORM.
MODIFY T_EVENTS INDEX SY-TABIX
FROM W_EVENT
TRANSPORTING FORM.
ENDIF.
ELSE.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. "build_events
*& Form top_of_page
To display top of page in ALV Report
FORM TOP_OF_PAGE. "#EC CALLED
DATA :
L_VKORG(35) TYPE C, "Sales Organization
L_VTWEG(35) TYPE C, "Distribution Channel
L_SPART(35) TYPE C. "Division
Title
CLEAR W_HEADER.
W_HEADER-TYP = C_H.
W_HEADER-INFO = TEXT-003.
APPEND W_HEADER TO T_HEADER.
Sales Organization
CLEAR W_HEADER.
W_HEADER-TYP = C_S.
CONCATENATE TEXT-004 P_VKORG INTO L_VKORG.
W_HEADER-INFO = L_VKORG.
APPEND W_HEADER TO T_HEADER.
Distribution Channel
CLEAR W_HEADER.
W_HEADER-TYP = C_S.
CONCATENATE TEXT-005 P_VTWEG INTO L_VTWEG.
W_HEADER-INFO = L_VTWEG.
APPEND W_HEADER TO T_HEADER.
Division
CLEAR W_HEADER.
W_HEADER-TYP = C_S.
CONCATENATE TEXT-006 P_SPART INTO L_SPART.
W_HEADER-INFO = L_SPART.
APPEND W_HEADER TO T_HEADER.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
IT_LIST_COMMENTARY = T_HEADER.
ENDFORM. "top_of_page
*& Form pf_status
To set PF-Status (user interface)
-->EXTAB The excluding table (function codes)
FORM PF_STATUS "#EC CALLED
USING T_EXTAB TYPE SLIS_T_EXTAB. "#EC NEEDED
SET PF-STATUS 'ZSTANDARD_FULLSCREEN'.
ENDFORM. "pf_status
*& Form display_alv_report
To display ALV report
FORM DISPLAY_ALV_REPORT.
CALL FUNCTION 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_CALLBACK_PROGRAM = G_REPID
I_CALLBACK_PF_STATUS_SET = 'PF_STATUS'
I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
IS_LAYOUT = W_LAYOUT
IT_FIELDCAT = T_FIELDCATALOG
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
I_DEFAULT = C_X
I_SAVE = C_A
IS_VARIANT =
IT_EVENTS = T_EVENTS[]
IT_EVENT_EXIT =
I_TABNAME_HEADER = 'T_IHEADER'
I_TABNAME_ITEM = 'T_IFINAL'
I_STRUCTURE_NAME_HEADER =
I_STRUCTURE_NAME_ITEM =
IS_KEYINFO = W_KEYINFO
IS_PRINT =
IS_REPREP_ID =
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE =
IR_SALV_HIERSEQ_ADAPTER =
IT_EXCEPT_QINFO =
I_SUPPRESS_EMPTY_DATA = ABAP_FALSE
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
T_OUTTAB_HEADER = T_IHEADER
T_OUTTAB_ITEM = T_IFINAL
EXCEPTIONS
PROGRAM_ERROR = 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.
ENDFORM. "display_alv_report
*& Form BUILD_FIELDCATALOG
To build ALV Field Catalog
FORM BUILD_FIELDCATALOG .
DATA: L_COUNT TYPE I VALUE 0.
CLEAR W_FIELDCATALOG.
L_COUNT = L_COUNT + 1.
W_FIELDCATALOG-COL_POS = L_COUNT.
W_FIELDCATALOG-TABNAME = C_HTNAME.
W_FIELDCATALOG-FIELDNAME = 'SELECT'.
W_FIELDCATALOG-SELTEXT_M = TEXT-C01.
W_FIELDCATALOG-CHECKBOX = C_X.
W_FIELDCATALOG-EDIT = C_X.
APPEND W_FIELDCATALOG TO T_FIELDCATALOG.
CLEAR W_FIELDCATALOG.
L_COUNT = L_COUNT + 1.
W_FIELDCATALOG-COL_POS = L_COUNT.
W_FIELDCATALOG-TABNAME = C_HTNAME.
W_FIELDCATALOG-FIELDNAME = 'VBELN'.
W_FIELDCATALOG-SELTEXT_M = TEXT-C02.
W_FIELDCATALOG-KEY = C_X. "Fixes the column for no-scroll
APPEND W_FIELDCATALOG TO T_FIELDCATALOG.
CLEAR W_FIELDCATALOG.
L_COUNT = L_COUNT + 1.
W_FIELDCATALOG-COL_POS = L_COUNT.
W_FIELDCATALOG-TABNAME = C_HTNAME.
W_FIELDCATALOG-FIELDNAME = 'KUNNR'.
W_FIELDCATALOG-SELTEXT_M = TEXT-C04.
APPEND W_FIELDCATALOG TO T_FIELDCATALOG.
CLEAR L_COUNT.
CLEAR W_FIELDCATALOG.
L_COUNT = L_COUNT + 1.
W_FIELDCATALOG-COL_POS = L_COUNT.
W_FIELDCATALOG-TABNAME = C_ITNAME.
W_FIELDCATALOG-FIELDNAME = 'POSNR'.
W_FIELDCATALOG-SELTEXT_M = TEXT-C03.
APPEND W_FIELDCATALOG TO T_FIELDCATALOG.
CLEAR W_FIELDCATALOG.
L_COUNT = L_COUNT + 1.
W_FIELDCATALOG-COL_POS = L_COUNT.
W_FIELDCATALOG-TABNAME = C_ITNAME.
W_FIELDCATALOG-FIELDNAME = 'KWMENG'.
W_FIELDCATALOG-SELTEXT_M = TEXT-C06.
W_FIELDCATALOG-EMPHASIZE = 'C400'.
APPEND W_FIELDCATALOG TO T_FIELDCATALOG.
CLEAR W_FIELDCATALOG.
L_COUNT = L_COUNT + 1.
W_FIELDCATALOG-COL_POS = L_COUNT.
W_FIELDCATALOG-TABNAME = C_ITNAME.
W_FIELDCATALOG-FIELDNAME = 'VRKME'.
W_FIELDCATALOG-SELTEXT_M = TEXT-C07.
W_FIELDCATALOG-JUST = C_R.
APPEND W_FIELDCATALOG TO T_FIELDCATALOG.
CLEAR W_FIELDCATALOG.
L_COUNT = L_COUNT + 1.
W_FIELDCATALOG-COL_POS = L_COUNT.
W_FIELDCATALOG-TABNAME = C_ITNAME.
W_FIELDCATALOG-FIELDNAME = 'NETPR'.
W_FIELDCATALOG-FIELDNAME = 'KZWI1'.
W_FIELDCATALOG-SELTEXT_M = TEXT-C08.
W_FIELDCATALOG-EMPHASIZE = 'C400'.
APPEND W_FIELDCATALOG TO T_FIELDCATALOG.
CLEAR W_FIELDCATALOG.
L_COUNT = L_COUNT + 1.
W_FIELDCATALOG-COL_POS = L_COUNT.
W_FIELDCATALOG-TABNAME = C_ITNAME.
W_FIELDCATALOG-FIELDNAME = 'VKAUS'.
W_FIELDCATALOG-SELTEXT_M = TEXT-C12.
W_FIELDCATALOG-JUST = C_R.
APPEND W_FIELDCATALOG TO T_FIELDCATALOG.
CLEAR W_FIELDCATALOG.
L_COUNT = L_COUNT + 1.
W_FIELDCATALOG-COL_POS = L_COUNT.
W_FIELDCATALOG-TABNAME = C_ITNAME.
W_FIELDCATALOG-FIELDNAME = 'ZZTECHSPEC'.
W_FIELDCATALOG-SELTEXT_M = TEXT-C09.
W_FIELDCATALOG-EMPHASIZE = 'C400'.
APPEND W_FIELDCATALOG TO T_FIELDCATALOG.
CLEAR W_FIELDCATALOG.
L_COUNT = L_COUNT + 1.
W_FIELDCATALOG-COL_POS = L_COUNT.
W_FIELDCATALOG-TABNAME = C_ITNAME.
W_FIELDCATALOG-FIELDNAME = 'MATNR'.
W_FIELDCATALOG-SELTEXT_M = TEXT-C05.
APPEND W_FIELDCATALOG TO T_FIELDCATALOG.
CLEAR W_FIELDCATALOG.
L_COUNT = L_COUNT + 1.
W_FIELDCATALOG-COL_POS = L_COUNT.
W_FIELDCATALOG-TABNAME = C_ITNAME.
W_FIELDCATALOG-FIELDNAME = 'PMATN'.
W_FIELDCATALOG-SELTEXT_M = TEXT-C10.
W_FIELDCATALOG-EMPHASIZE = 'C400'.
APPEND W_FIELDCATALOG TO T_FIELDCATALOG.
CLEAR W_FIELDCATALOG.
L_COUNT = L_COUNT + 1.
W_FIELDCATALOG-COL_POS = L_COUNT.
W_FIELDCATALOG-TABNAME = C_ITNAME.
W_FIELDCATALOG-FIELDNAME = 'KONDM'.
W_FIELDCATALOG-SELTEXT_M = TEXT-C11.
APPEND W_FIELDCATALOG TO T_FIELDCATALOG.
ENDFORM. " BUILD_FIELDCATALOG
*& Form user_command
EXIT routine for command handling
-->L_UCOMM Function code that PAI triggered
-->W_SELFIELD Information cursor position ALV
FORM USER_COMMAND USING L_UCOMM LIKE SY-UCOMM "#EC CALLED
W_SELFIELD TYPE SLIS_SELFIELD. "#EC NEEDED
Check function code
CASE L_UCOMM.
WHEN 'CREATE'.
SORT T_IHEADER BY SELECT.
READ TABLE T_IHEADER INTO W_IHEADER
WITH KEY SELECT = C_X
BINARY SEARCH.
IF SY-SUBRC <> 0.
MESSAGE I000(ZS) WITH TEXT-M01.
ELSE.
CLEAR : G_ANSWER.
Dialog box for save prompts
CALL FUNCTION 'POPUP_TO_CONFIRM'
EXPORTING
TEXT_QUESTION = TEXT-OP1
DISPLAY_CANCEL_BUTTON = ''
IMPORTING
ANSWER = G_ANSWER
EXCEPTIONS
TEXT_NOT_FOUND = 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.
ELSE.
IF G_ANSWER = 1.
SET PF-STATUS 'ZSTANDARD_SCREEN'.
PERFORM DATA_IDENTITY_4_ACCESS_SEQ.
PERFORM CREATE_CONDITIONS.
PERFORM DISPLAY_RESULT.
ENDIF.
ENDIF.
ENDIF.
WHEN '&REFRESH'.
SUBMIT ZSPRENH069 USING SELECTION-SCREEN 1000
WITH SELECTION-TABLE T_SELECT.
WHEN 'BACKTO'.
SUBMIT ZSPRENH069 USING SELECTION-SCREEN 1000
WITH SELECTION-TABLE T_SELECT.
ENDCASE.
ENDFORM. "user_command
*& Form DATA_IDENTITY_4_ACCESS_SEQ
Seperates the Available Data for processing for both Access Sequences
FORM DATA_IDENTITY_4_ACCESS_SEQ .
CLEAR : W_IFINAL,
W_ACC1,
W_ACC2.
SORT T_MVKE BY MATNR VKORG VTWEG.
LOOP AT T_IHEADER INTO W_IHEADER WHERE SELECT = C_X.
LOOP AT T_IFINAL INTO W -
Obligatory fields in a Maintenance View
Hi All,
I have a Z table. I have created a Maintenance View for this table. My requirement is to have a few fields as mandatory in this view so that when the user enters data, these fields should appear with the Obligatory symbol in the grid.
Regards,
MadhurHi Madhur,
Whenever u craete a table maintainence view one or two screens are generated depending upon the option u have selected.
goto SE11 ->utilities ->table maintainence .
there find ur screen no ( 1 by default)
click on that u will enter into screen painter.
There find ur field and specify its attribute as required. Dont forget to activate the screen onece done.
Thanks & Regards,
Ankur -
Md04 - additional columns as pushbutton
Implementing the badi MD_ADD_COL_EZPS
How can I add a column and the content of the column is a pushbutton ????
thanks in advance
StephanHi Stephen,
I just made this particular enhancement. You first have to check if the BADI - MD_ADD_COL_EZPS - is activated. If it is then you will have to do the enhancement using the BADI, else you can use the combination of the two following User-exits :
EXIT_SAPLM61R_001, EXIT_SAPMM61R_001.
Thanks & Regards,
Aditya -
Leaving dynpro with obligatory fields.
Hi everyone.
What I'm trying to find is some way to leave (using a cancel button) a dynpro that has obligatory fields without having to complete them.
What I've done is including the following code in the PBO user-command module:
case sy-ucomm.
when '&CANC'.
leave to screen 0.
when '&OK'.
endcase.
What happens is that every time that I hit cancel, an error message that says that I must complete every obligatory field pops up and I have to do that in order to leave the dynpro. ¿Any idea about how to fix this?
Thanks a lot,
Fernando.Hi,
IN the GUI STATUS for the function code &CANC .have the function type as 'E' (Exit command).
Then in the PAI..have a new module ..
MODULE EXIT_COMMAND AT EXIT-COMMAND.
In that module have your code for CANC function code..
Thanks,
Naren -
Down Payment Clearing pushbutton in MIRO (SAP ECC6 EP4) after F-48
Hi,
I have tried all sorts of steps, but I am unable to see this Down Payment Clearing pushbutton in MIRO transaction.
Required package - LOG_MMFI_P2P is already installed and found OK in SFW5.
Down payment maintained in PO, request created in F-48 and now I am trying to clear it in MIRO, but this button is not visible.
Any clue?
Please revert.
Regards,
DipakDear Experts,
As i am trying to do the same process in my organisation to post the DP in PO at header or item level and after that following the ME2DP process for posting DP and then i do MIGO.
After GR as i do MIRO process and select the PO there is no DOWN PAYMENT Push button on header level on MIRO Screen.
I already re-started the Business Function "LOG_MMFI_P2P" after that also it is not showing the push button.
Please kindly help in this to get that DOWN PAYMENT clearing button?
Regards
Arun Rai -
Custom pushbutton in ME21N should display a popup window with item details
Hello,,
The requirement is to
1. Add a custom pushbutton in ME21N screen at header level.
2. The user will select some PO line items and will click on this push button.
This inturn should trigger a popup window with item details only for those selected PO line items along with schedule line qty.
I have created the custom push button in a custom tab using the BADI ME_GUI_PO_CUST.
Now I am not able to retrieve item details and schedule line details inside the PAI of the custom tab..
i.e., when i click on the custom push button, I am not able to retrive the item data and schedule line data.
Please help me to retrive PO line item data and schedule line data.
Regards,
SharahJSF is not so relevant in this question. It's all about how the generated client side code look like. Which is usually a bunch of HTML/CSS/JS (open page in browser, rightclick and view source). If you know HTML, you should know that using target="_blank" in a <form> or <a> element would open a new window. If you know JS, you should know that using window.open() would open a new window.
Apply this so in the JSF source code so that the generated HTML/JS output is exactly what you want. -
Regarding pushbutton operation in alv report
hi,
I have a requiement in which i will get list display which contains certain no of records(let us say 10 records)...now the issue is *if i selet one record and if it is correct record* and if i hit the insert pushbutton it should go and insert into z-table which i hav created.....and if the record which i hav selected is error record.....it should throw an error message saying that it is the error record....as error record stops further process i hav used it as information message and i used 'display like 'E''....so that it wont affect further proceedings.....
and if i select the 2nd record and if i hit the pushbutton it is taking to the sap initial screen which i dont want .....
how to solve this issue?
can anyone plz help me in this issue....Hi Needy ,
M giving you a sample code where you can set your pf-status and how to handle the check box etc .
This code shows you hoe to select and deselect the check boxes ..
All that you have to do is apply your logic...
set pf-status 'SELECT' .
at user-command .
describe table t_lpr lines w_lines .
case sy-ucomm .
when 'SELECTALL' .
set pf-status 'SELECT' excluding 'SELECTALL' immediately.
do w_lines times .
read line w_line field value w_check . " INTO W_CHECK .
if w_check = space .
w_check = 'X' .
modify line w_line field value w_check. "INTO W_CHECK .
add 1 to w_line .
endif . " IF W_CHECK = ' '
enddo . " DO W_LINES TIMES
clear w_line .
when 'DESELECT' .
set pf-status 'SELECT' excluding 'DESELECT' immediately.
do w_lines times .
read line w_line field value w_check .
if w_check = 'X' .
w_check = space .
modify line w_line field value w_check .
add 1 to w_line .
endif . " IF W_CHECK = 'X' .
enddo . " DO W_LINES TIMES
clear w_line .
Here w_line : Line that is being read
w_lines : Total number of lines in your table(or list if you use 'list number of lines w_lines)
w_check is my checkbox .
Hope your need will be done!!
Much Regards ,
Amuktha . -
Hi all,
is it possible to make a cell input obligatory in a grid without additional (I mean event handling) abap coding?
Moreover the small question mark (or tick in new design) indicating the obligatory input would be a 'nice to have' feature. If you have any idea please help.
regards
:busHi,
I have the same question - has anyone found the solution?
I did review most of the CL_GUI_ALV_GRID methods and LVC_S_LAYO and LVC_T_FCAT options.
Thank you!
MayM -
Display a cell in ALV report as Pushbutton
Hi,
I am having an ALV report. I want to display one cell of the ALV report as a Pushbutton. How is it possible ?
Thanks and regards.Hi WTM,
To display a cell as pushbutton in container display of a simple, two-dimensional table, use the cell type BUTTON.
cell type -->
In the content of your ALV output, you are able to display various elements in place of text. Some of these elements can be treated as a click area for the user. You are able to display the following elements:
· Checkbox
In list-type ALV ouputs, the checkbox is disabled. With the content of the column, you are only to display whether the checkbox is set or not.
In the tree structure, however, you are able to handle users actions on this element using an event.
· Pushbutton
You are able to handle user actions on this element with an event.
· Hyperlink
You specify the Internet addresses (URLs). Users can then call up the corresponding page in the Internet browser by clicking on one of these Internet addresses.
· Click Area
You are able to handle user actions on this element with an event.
Hope this helps u,
Regards,
Nagarajan. -
Tooltip on pushbutton on alv report selection screen
Hi Experts,
I have a selection screen with two pushbuttons i want to provide tooltip on this button when user takes his cursor on it .. some part of my code
Selection screen:
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-t01.
SELECTION-SCREEN: BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(20) text-t02 FOR FIELD p_info.
PARAMETERS: p_info TYPE string.
SELECTION-SCREEN: PUSHBUTTON 68(10) but1 USER-COMMAND cli1.
SELECTION-SCREEN : END OF LINE.
PARAMETERS: r_exe_im RADIOBUTTON GROUP rb1.
PARAMETERS: r_st RADIOBUTTON GROUP rb1.
SELECTION-SCREEN SKIP 1.
SELECTION-SCREEN: PUSHBUTTON /1(20) exec1 USER-COMMAND cli2.
SELECTION-SCREEN: FUNCTION KEY 1.
SELECTION-SCREEN END OF BLOCK b1.
please tell me on these selection fields how to display tool tip.
Thanks and regards,
Roshan.Hi,
After completing your executable program in SE38, activate it and goto SE51(Screen painter).
Here give the name of your program and screen number as 1000.
Click on Change.
Goto Element List Tab.
Here you will find all your elements from your program.
Select the required element and click on Properties.
Here you will find a Tooltip Text property. Click on the button 'Text' of this property.
You will be given 2 options 1) Text from Text element 2) Text from Variable
Enter as per requirement
Save and Activate.
Hope this will be useful
Regards
Bhupal -
Pushbutton disabled in a table
Hello.
I would like to see a pushbutton enabled at the end of each row depending the result of the comparaison of two fields in my table.
To explain much better, I want that only the personne who created the recording in the table would be allowed to delete its. So I check if the ID of the recording creator is the same as the current user, and depending this result, the pushbutton to delete the row has to be enabled.
So I marked the checkbox "disabled" in my pushbutton options and written the following condition :
bool ( if ( @ID == @CurrentID , 1 , 0 ))
The function is ok (I checked by displaying the result in another variable)... But it doesn't work !!!
So I tried to write directly "true" or "false" in the display condition, and : There is no difference between both, the pushbutton is desactivated in each case. So I don't understand.
Can Somebody help me please ?Hi,
I tried the same and it worked for me the way it should. Just make sure that you have assigned some action to the button because if we haven't assigned any action then it would always be disabled.
Also, your table is set as Editable and not Read Only
Regards,
Murtuza -
Obligatory Fields in Moule Pool
Hi all,
My requirement is such that...
I have created 2 radiobuttons in the selection screen
When I select the 1st button, a particular field in the same screen should become obligatory and when I select the 2nd button another field should become obligatory.
Can anyone tell me how to achieve this?
Thanks,
AmritaHi,
You can try Loop At Screen Statement,
That is in the PBO of the selection screen
you can check the Screen Goup the one that is
assigned to both the radio buttons in if else statements,
If the first radio button is selected you can give the field names
required for the first radion button selection output by giving
screen-name = Field name and make
field-required = 'X' .
Same for the else statement for second radio button.
Hope it helps
Regards
Mansi
Maybe you are looking for
-
Windows 8.1 on BootCamp WiFi Problem
Hey, I installed Win 8.1 via BootCamp on my Macbook Pro late 2014. All is fine except WiFi .. It keeps dropping. When I run diagnostics it says "Default Gateway Not Available" and it resets the wifi adapter. And it fixed it for 15-20-30 minutes and t
-
I have tried to look at reasons as to why this happens but i cannot find anything. If i type it in manually it works perfectly fine. The copying and pasting of text into the name of the file freezes and crashes the window i am in
-
Syncing with iCloud from iTunes and MobileMe
I'm having trouble syncing my iphone and computer with icloud because I had a differenct itunes account then mobile me. I wanted to sync my music from my itunes account so I did that but now I'm all tangled up. When I synced my computer it transfer
-
My phone says searching.. i cant call or anything whats going on
can i get some help.. my iphone says searching...i have no signal.. what is going on .
-
Is there a way in which I can perform on an operation on a range within a function ? For example, I have two columns - column A and column B. I am interested in computing the sumproduct(col A, col B) which is a straight forward function call. Now, in