2007 Dec 19 2:40 PM
HI Guys,
How can we do mass activation of custom ABAP Queries after version Upgrade?.
Thanks,
Gourisankar.
2007 Dec 19 2:44 PM
when u say to activate.. in that screen use F9 to select all and hit activate
2007 Dec 19 4:08 PM
Use this program
REPORT ZBC_QUERYGEN .
TABLES: aqlqcat,
aqgqcat.
DATA: "gt_query LIKE TABLE OF AQLQCAT WITH HEADER LINE,
gc_work LIKE AQADEF-WSID,
gc_message(128) TYPE C,
gn_num(2) TYPE N.
DATA: BEGIN OF gt_query OCCURS 0,
num TYPE aqlqcat-num,
qnum TYPE aqlqcat-qnum,
clas TYPE aqlqcat-clas,
END OF gt_query.
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
SELECT-OPTIONS: s_qnum FOR aqlqcat-qnum.
SELECTION-SCREEN SKIP 1.
PARAMETERS: p_all RADIOBUTTON GROUP 1,
p_std RADIOBUTTON GROUP 1,
p_global RADIOBUTTON GROUP 1.
SELECTION-SCREEN END OF BLOCK B1.
IF NOT p_all IS INITIAL OR NOT p_global IS INITIAL.
" Get all queries/usergroups/inforecs etc.
SELECT num qnum clas
INTO TABLE gt_query
FROM AQGQCAT
WHERE qnum IN s_qnum.
SORT gt_query BY NUM QNUM ASCENDING.
*Generate for all Global area queries first.
gc_work = 'X'.
WRITE:/ 'Generating Global area code'. ULINE.
LOOP AT gt_query.
IF sy-batch EQ ' '.
CONCATENATE 'Generating code for' gt_query-num '/' gt_query-qnum
'in Global area' INTO gc_message SEPARATED BY SPACE.
CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
EXPORTING
PERCENTAGE = 0
TEXT = gc_message.
ENDIF.
CALL FUNCTION 'RSAQ_GENERATE_PROGRAM'
EXPORTING
I_WORKSPACE = gc_work
I_QUERY = gt_query-qnum
I_USERGROUP = gt_query-num
EXCEPTIONS
NO_QUERY = 1
NO_INFOSET = 2
QUERY_LOCKED = 3
GENERATION_CANCELLED = 4
GENERATION_ERROR = 5
OTHERS = 6.
gn_num = sy-subrc.
IF SY-SUBRC EQ 0.
CONCATENATE 'Program generated for usergroup' gt_query-num
'Query' gt_query-qnum 'in Global area.'
INTO gc_message SEPARATED BY SPACE.
WRITE:/ gc_message.
ELSE.
gn_num = sy-subrc.
CONCATENATE 'Program could NOT be generated for usergroup'
gt_query-num
'Query' gt_query-qnum 'ERROR = ' gn_num '.'
INTO gc_message SEPARATED BY SPACE.
WRITE:/ gc_message.
ENDIF.
ENDLOOP.
ENDIF.
IF NOT p_all IS INITIAL OR NOT p_std IS INITIAL.
REFRESH gt_query.
" Get all queries/usergroups/inforecs etc.
SELECT num qnum clas
INTO TABLE gt_query
FROM AQLQCAT
WHERE qnum IN s_qnum.
SORT gt_query BY NUM QNUM ASCENDING.
*Generate for all Standard area queries first.
ULINE.
gc_work = ''.
WRITE:/ 'Generating Standard area code'. ULINE.
LOOP AT gt_query.
IF sy-batch EQ ' '.
CONCATENATE 'Generating code for' gt_query-num '/' gt_query-qnum
'in Standard area' INTO gc_message SEPARATED BY SPACE.
CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
EXPORTING
PERCENTAGE = 0
TEXT = gc_message.
ENDIF.
CALL FUNCTION 'RSAQ_GENERATE_PROGRAM'
EXPORTING
I_WORKSPACE = gc_work
I_QUERY = gt_query-qnum
I_USERGROUP = gt_query-num
EXCEPTIONS
NO_QUERY = 1
NO_INFOSET = 2
QUERY_LOCKED = 3
GENERATION_CANCELLED = 4
GENERATION_ERROR = 5
OTHERS = 6.
gn_num = sy-subrc.
IF SY-SUBRC EQ 0.
CONCATENATE 'Program generated for usergroup' gt_query-num
'Query' gt_query-qnum 'in Global area.'
INTO gc_message SEPARATED BY SPACE.
WRITE:/ gc_message.
ELSE.
gn_num = sy-subrc.
CONCATENATE 'Program could NOT be generated for usergroup'
gt_query-num
'Query' gt_query-qnum 'ERROR = ' gn_num '.'
INTO gc_message SEPARATED BY SPACE.
WRITE:/ gc_message.
ENDIF.
ENDLOOP.
ENDIF.
2007 Dec 19 4:18 PM
There is a SAP note 109094 that talks about conversion post upgrade. I guess you need to run program RSAQUM40 for mass conversion.
-Cheers