Try this..We create the coding in the notepad then this program will compile the coding and running the coding. I can called this program as ABAP Query Analyzer.
*Dynamic manipulation of report programs
*......................................................................
*: Report ZDYNAMICCODE :
*:.....................................................................
*: Execute ABAP from a PC file(.txt) :
*: Therefor allowing any abap code to be executed on any client :
*: which contains this program :
*: :
*.....................................................................:
REPORT zdynamiccode .
TABLES rlgrap.
*selection screen creation
PARAMETER: p_file(200) TYPE c,
p_temp(30) TYPE c DEFAULT 'Z123TEMP_REPORT_FOR_CODE'.
*data declaration
DATA: it_tab TYPE filetable,
gd_subrc TYPE i,
answer TYPE c.
TYPES: BEGIN OF t_abapcode,
row(72) TYPE c,
END OF t_abapcode.
DATA: it_abapcode TYPE STANDARD TABLE OF t_abapcode INITIAL SIZE 0,
it_store TYPE STANDARD TABLE OF t_abapcode INITIAL SIZE 0.
DATA: filename TYPE string.
************************************************************************
*AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
*Selecting a File, plus inserting default file extension
REFRESH: it_tab.
CALL METHOD cl_gui_frontend_services=>file_open_dialog
EXPORTING
window_title = 'Select File'
default_filename = '*.txt'
multiselection = ' '
CHANGING
file_table = it_tab
rc = gd_subrc.
LOOP AT it_tab INTO p_file.
ENDLOOP.
************************************************************************
*START-OF-SELECTION.
START-OF-SELECTION.
*move file name into a field with type compatable with FM
filename = p_file.
*upload file from PC
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = filename
TABLES
data_tab = it_abapcode
EXCEPTIONS
file_open_error = 1
file_read_error = 2
no_batch = 3
gui_refuse_filetransfer = 4
invalid_type = 5
no_authority = 6
unknown_error = 7
bad_data_format = 8
header_not_allowed = 9
separator_not_allowed = 10
header_too_long = 11
unknown_dp_error = 12
access_denied = 13
dp_out_of_memory = 14
disk_full = 15
dp_timeout = 16
OTHERS = 17.
IF sy-subrc EQ 0.
* Check if report name being used fro temorary code already exists as
* any code will be over written and lost
READ REPORT p_temp INTO it_store.
IF sy-subrc NE 0.
* Please note any existing code in the program will be lost!!!!
INSERT REPORT p_temp FROM it_abapcode.
SUBMIT (p_temp) AND RETURN.
DELETE REPORT p_temp.
ELSE.
CALL FUNCTION 'POPUP_TO_CONFIRM'
EXPORTING
text_question = 'Report used to store temporary code already
exists!!! Do you want to overwrite it?'
IMPORTING
answer = answer.
IF sy-subrc EQ 0.
IF answer EQ '1'. "yes
* Please note any existing code in the program will be lost!!!!
INSERT REPORT p_temp FROM it_abapcode.
SUBMIT (p_temp) AND RETURN.
DELETE REPORT p_temp.
ENDIF.
ENDIF.
ENDIF.
ENDIF.
October 28, 2009
October 08, 2009
ABAP Query
Step for create abap query :
There are five steps for creating our own query for searching data based on keyword.
1. Creation of user group.
/NSQ03--- create user group---- write user group name & description.
2. Creation of Infoset.
/NSQ02 --- create Infoset---- write infoset name and description--- Select logical database--- select CKM.
Create field group --- copy required parameters for under field group--- Generate infoset.
3. Assignment of user group with Infoset.
/NSQ03-- - enter user group and infoset--- select user group for assignment--- save.
4. Creation of Query.
/NSQ01--- create query ---- select infoset--- Basic list icon click--- go to MARA General Material --- select check box under column “list fields” & “selection fields” for each parameter selected in logical database set—Execute query--- copy “Repository data “ from system status.
5. Creation of transaction code.
/NSE93--- Create transaction code---- paste copied “Repository data” in program field--- creates the transaction code.
There are five steps for creating our own query for searching data based on keyword.
1. Creation of user group.
/NSQ03--- create user group---- write user group name & description.
2. Creation of Infoset.
/NSQ02 --- create Infoset---- write infoset name and description--- Select logical database--- select CKM.
Create field group --- copy required parameters for under field group--- Generate infoset.
3. Assignment of user group with Infoset.
/NSQ03-- - enter user group and infoset--- select user group for assignment--- save.
4. Creation of Query.
/NSQ01--- create query ---- select infoset--- Basic list icon click--- go to MARA General Material --- select check box under column “list fields” & “selection fields” for each parameter selected in logical database set—Execute query--- copy “Repository data “ from system status.
5. Creation of transaction code.
/NSE93--- Create transaction code---- paste copied “Repository data” in program field--- creates the transaction code.
October 03, 2009
Edit program in Production Server
Step to change program in Production server as following this :
1. Open SE38 and search program LSTRDU34 then click Display button.
2. Set breakpoint for line "IF sy-subrc NE 0".
3. Open SE38 and search program LSTRDU44 then click display button.
4. Set breakpoint for line "IF sy-subrc NE 0".
5. Open SE38 and search program which you want to edit.
6. Then click Change Button.
7. It will run program LSTRDU34 and stop to the breakpoint..Then you must change the value sy-subrc = 0.
8. After that click F8 button.
9. CHANGE YOUR CODING.
10. Then click Activate button.
11. It will run program LSTRDU44 and stop to the breakpoint..Then you must change the value sy-subrc = 0.
12. Click F8 button.
13. You already change your coding.
Note : Need authorization to change value in Debug mode.
1. Open SE38 and search program LSTRDU34 then click Display button.
2. Set breakpoint for line "IF sy-subrc NE 0".
3. Open SE38 and search program LSTRDU44 then click display button.
4. Set breakpoint for line "IF sy-subrc NE 0".
5. Open SE38 and search program which you want to edit.
6. Then click Change Button.
7. It will run program LSTRDU34 and stop to the breakpoint..Then you must change the value sy-subrc = 0.
8. After that click F8 button.
9. CHANGE YOUR CODING.
10. Then click Activate button.
11. It will run program LSTRDU44 and stop to the breakpoint..Then you must change the value sy-subrc = 0.
12. Click F8 button.
13. You already change your coding.
Note : Need authorization to change value in Debug mode.
Labels:
ABAP
Subscribe to:
Posts (Atom)