T.code of resp. program to be displayed in ALV as heading or header
Hi !
I have a rather simple yet confusing question for me.
My requirement is to display the respective transaction code of the Zreport in the report itself.
I am able to display it in classical format but unable to figure out a way in ALV format.
Can you please help me find a way to display the report's respective T.CODE in the report header or footer.
thanx in advance.
You can do this with FM REUSE_ALV_COMMENTARY_WRITE
Rob
Similar Messages
-
How to get the ANSI codes in the program
Hi,
In my program, I have to get the ANSI codes 30 and 31 in the program. After getting those codes, I have to concatenate with some other text and display in the report.
Can someone tell me how to get these ANSI codes in the program..?
Is there any function module to get the ANSI codes in the program. or Is there any other way to get the ANSI codes in the program.
Please help me. It is quite urgent.
Thanks in advance,
Best Regards,
Pradeep.hi check this ....
How can I get Ascii value of any letter
How can I get Ascii value of any letter. Is there any function?
This is how you do it :
report demtest.
data : c.
field-symbols : <n> type x.
data : rn type i.
c = 'A'.
assign c to <n> casting.
move <n> to rn.
write rn.
This will convert 'A' to 65.
Tom Demuyt
How to convert ascii value to character.
If I give input as 65 (ascill value) I want display 'A'.
Below logic is for convert from character to ascii value , now I want to know how to convert ascii value to character.
Naveen
report demtest.
*going from A to 65
data : c value 'A'.
field-symbols : <n> type x.
data : rn type i.
assign c to <n> casting.
move <n> to rn.
write rn.
*going from 66 to B
data : i type i value 66.
data : x type x.
field-symbols : <fc> type c.
move i to x.
assign x to <fc> casting type c.
move <fc> to c.
write c.
regards,
venkat. -
How to get CS6 program icons to display?
How to get CS6 program icons to display?
This is the error message I get
Exit Code: 6
Please see specific errors below for troubleshooting. For example, ERROR:
-------------------------------------- Summary --------------------------------------
- 0 fatal error(s), 2 error(s)
----------- Payload: Microsoft Visual C++ 2012 Redistributable Package (x86) 11.0.61030.0 {873BE68F-480F-49A6-9649-F98CAB056AFC} -----------
ERROR: Third party payload installer vcredist_x86.exe failed with exit code: -2147024546
ERROR: Failed to install Microsoft Visual C++ 2012 Redistributable Package (x86). Please try installing it by double clicking on the executable at "C:\Users\Antia\AppData\Local\Temp\{7976D5C1-6469-483B-B4CB-179D91E4C7E0}\Photoshop_15_LS 20_win64\Adobe CC 2014\payloads\Microsoft VC 2012 Redist (x86)\vcredist_x86.exe", or download and install the latest Microsoft Visual C++ 2012 Redistributable Package (x86) from Microsoft website - www.microsoft.com -
Step by step code for dialog program
i created a ztable with 4 fields having some data in it.
my requirement is:
create a screen with 4 fields from ur ztable with SAVE and CANCEL as push buttons.
if i enter some data in my fields and select SAVE, a pop-up-box should appear saying whether u want to save the data or not?
if i click 'yes' in my pop-up data should be saved in my ztable
saying 'data is saved successfully'.else if i click 'no' it should come out of the txion.
if i select CANCEL it should be in the same screen.Hi nani,
First you need to create a screen with 4 inputs fields as you mentioned.
To create a screen,follow these steps:
1) Go to SE80.There you will find two drop down boxes.
Select program in the first list box and give the name of the program you want in the second list bo.
2)Click on SAVE.
3)Right click on the program name and there you will find a small menu.Go to CREATE--->SCREEN.
4)A window would open now.There give a number to the screen and a description to it and press on SAVE.Now the screen is created.
Now you need to add the input fields in the screen.To do this follow these steps:
1)Click on the layout button which you will finid on the top of the scrren window.This leads you to the screen painter.
2)In the screen painter you will find a list of buttons on the left hand side.
3)Select the button which says input/output field.
4)Now paste the input/output field in the screen.
5)Double click on it and a pop up will open.There you need to give the name of the field.
Here you will have to give the name in this format: <Ztable_name>-<field_name>.
For e.g: ztm09ekko-ebeln.
By giving the name of the field same as the field name in the Ztable,the field will be linked to the Ztable field.
Follow the same steps for the rest of the input/output fields creation.
Now you need to create two push buttons.The steps are:
1)Go to the screen layout again and now select push buttons from the menu on the left hand side.
2)Paste in on the screen.
3)Double click on it and a popup will open.There you need to give the name of the push button.Here you will also find a field by name Fct.Code.This is the field for the function code of the push button.
Give an appropriate function code name like SAVE and CANCEL in your case.
After doing all this,you need to activate the screen.
Now to make the push buttons working,you need to write a code for it.
To write the code,exit the screen layout and click on the flow logic tab that you will find above.
Go through this code and you will easily understand how to write it for your requirement.
You can use the same code in your program just by changing the table names.
In this code a function module is called to display the popup.The popup contains three options-Yes,No and Cancel.When selecting Yes,The details present in the input fields will be saved in the Ztables.If NO is selected in the popup,then the transaction will be exited.
In the function module,answer holds the user command.
e_answer needs to be created by user.The statement for it is :
DATA :e_answer type c.
In the function module as you can see, J indicates Yes and N indicates No.
And if you click on the CANCEL push button,
The same screen is retained as per your requirement.
In the PAI module of that Screen,
write this code:
CASE SY-UCOMM.
when SAVE.
CALL FUNCTION 'C14A_POPUP_SAVE_WITH_CANCEL'
IMPORTING
e_answer = answer.
IF answer = 'N'.
***Leaving the transaction****
LEAVE TRANSACTION.
ELSEIF answer = 'J'.
***The right side of the equation is the name of the input field in the screen.The left hand side of the ****equation is the field name in the ZTable ztm09_ekpo.**
ztm09_ekpo-ebeln = ztm09_ekko-ebeln. "ztm09_ekko is the name of the Z Table.
MODIFY ztm09_ekpo.
when CANCEL.
set data hold on.
endcase.
Revert for any querries.
Reward points if helpfull.
Regards,
Kaushik -
I just purchase my first IMac with lion and I was trying to install a math program I bought 6 years ago. When I went to boot it off the disk while following the program instructions a window popped up with a note pad format with symbols and codes but the program would not download or open. How do I get this program to work? It is a mac compatible program by the way.
Your Mac probably does not know with which application to open the file and is opening a file with a text editor that really needs to be opened by the application itself. Try starting the application first, then use the File > open command to open the file.
As varjak paw comments, there isn't a "winmac" so that's not telling us anything.
Note that it is possible that software purchased 6 years ago may no longer run on your computer. Once we know what it is we can help more. -
How can we know the return code of BDC Program ?
Hi All,
Please tell me : How can we know the return code of BDC Program when being exceuted in Session or in Transaction mode.
In my program, we are uploading data from Excel sheet to SAP via BDC
The records that are not updated we want to create a log file.
Now to know whether a record is updated ot not, wat syst field shloud be used?
Its urgent....
<b>Reward Point will be there ....</b>
Thanks,
HarishHi harish,
try the logic in this code ...
i had attached input file in the end.
TYPES: begin of errmess,
msgnr type t100-msgnr,
text type t100-text,
end of errmess.
TABLES : t100.
DATA: BEGIN OF DD_VA01,
AUART TYPE VBAK-AUART,
KUNNR TYPE RV45A-KUNNR,
BSTKD TYPE VBKD-BSTKD,
MABNR TYPE RV45A-MABNR,
KWMENG(2) type C,
KBETR(2) type C,
END OF DD_VA01.
DATA:IT_VA01 Like TABLE OF DD_VA01,
WA_VA01 Like LINE OF IT_VA01,
WA_VA01_F Like LINE OF IT_VA01,
IT_BDCDATA TYPE TABLE OF BDCDATA,
WA_BDCDATA Like Line OF IT_BDCDATA,
W_FNAME TYPE STRING,
messtab like bdcmsgcoll occurs 0 with header line,
it_errmess type table of errmess,
wa_errmess like line of it_errmess,
err_message type string.
data: zf1 type i,
zc1 type c value '2',
fn(20) type c.
Main Code ************************************************************
PERFORM get_input using 'C:\Documents and Settings\ic881592\Desktop\Daran_bdc_VA01-e.txt'.
SORT IT_VA01 BY AUART KUNNR BSTKD.
LOOP AT IT_VA01 INTO WA_VA01.
if WA_VA01_F-AUART <> WA_VA01-AUART OR
WA_VA01_F-KUNNR <> WA_VA01-KUNNR OR
WA_VA01_F-BSTKD <> WA_VA01-BSTKD.
PERFORM set_header_flag.
PERFORM create_bdc_header_data.
endif.
PERFORM create_bdc_item_data.
ENDLOOP.
PERFORM call_transaction.
PERFORM errorlog.
Procedures ***********************************************************
form get_input using w_fname.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = W_FNAME
HAS_FIELD_SEPARATOR = '#'
TABLES
DATA_TAB = IT_VA01.
endform.
form call_transaction.
PERFORM bdc_field using 'BDC_OKCODE' '/11'.
CALL TRANSACTION 'VA01' USING IT_BDCDATA MODE 'A' messages into messtab.
refresh it_bdcdata.
endform.
FORM set_header_flag.
WA_VA01_F-AUART = WA_VA01-AUART.
WA_VA01_F-KUNNR = WA_VA01-KUNNR.
WA_VA01_F-BSTKD = WA_VA01-BSTKD.
if zf1 = 1.
PERFORM call_transaction.
endif.
zf1 = 1.
endform. "set_header_flag.
form create_bdc_header_data.
perform bdc_dynpro using 'SAPMV45A' '0101'.
perform bdc_field using 'VBAK-AUART' WA_VA01-AUART.
perform bdc_field using 'BDC_OKCODE' '/00'.
perform bdc_dynpro using 'SAPMV45A' '4001'.
perform bdc_field using 'KUAGV-KUNNR' WA_VA01-KUNNR.
perform bdc_field using 'VBKD-BSTKD' WA_VA01-BSTKD.
perform bdc_field using 'BDC_OKCODE' '/00'.
perform bdc_dynpro using 'SAPMSSY0' '0120'.
perform bdc_field using 'BDC_CURSOR' '04/06'.
perform bdc_field using 'BDC_OKCODE' '=CHOO'.
perform bdc_dynpro using 'SAPMV45A' '4001'.
PERFORM bdc_field USING 'BDC_OKCODE' '=POAN'.
endform. "create_bdcdata
FORM create_bdc_item_data.
CONCATENATE 'RV45A-KWMENG(' zc1 ')' INTO FN.
perform bdc_field using 'BDC_CURSOR' FN.
perform bdc_field using FN WA_VA01-KWMENG.
CONCATENATE 'KOMV-KBETR(' zc1 ')' INTO FN.
perform bdc_field using FN WA_VA01-KBETR.
CONCATENATE 'RV45A-MABNR(' zc1 ')' INTO FN.
perform bdc_field using FN WA_VA01-MABNR.
perform bdc_dynpro using 'SAPMV45A' '4001'.
PERFORM bdc_field USING 'BDC_OKCODE' '=POAN'.
ENDFORM.
form errorlog.
LOOP AT MESSTAB .
if MESSTAB-MSGNR = '311' or MESSTAB-MSGTYP = 'E'.
SELECT SINGLE msgnr text FROM T100
into wa_errmess
WHERE SPRSL = MESSTAB-MSGSPRA
AND ARBGB = MESSTAB-MSGID
AND MSGNR = MESSTAB-MSGNR.
IF SY-SUBRC = 0.
err_message = wa_errmess-TEXT.
IF err_message CS '&1'.
REPLACE '&1' WITH MESSTAB-MSGV1 INTO err_message.
REPLACE '&2' WITH MESSTAB-MSGV2 INTO err_message.
REPLACE '&3' WITH MESSTAB-MSGV3 INTO err_message.
REPLACE '&4' WITH MESSTAB-MSGV4 INTO err_message.
ELSE.
REPLACE '&' WITH MESSTAB-MSGV1 INTO err_message.
REPLACE '&' WITH MESSTAB-MSGV2 INTO err_message.
REPLACE '&' WITH MESSTAB-MSGV3 INTO err_message.
REPLACE '&' WITH MESSTAB-MSGV4 INTO err_message.
ENDIF.
CONDENSE err_message.
WRITE: / MESSTAB-MSGTYP, err_message .
ELSE.
WRITE: / MESSTAB.
ENDIF.
endif.
ENDLOOP.
endform. "errorlog
FORM BDC_DYNPRO USING PROGRAM DYNPRO.
WA_BDCDATA-PROGRAM = PROGRAM.
WA_BDCDATA-DYNPRO = DYNPRO.
WA_BDCDATA-DYNBEGIN = 'X'.
APPEND WA_BDCDATA TO IT_BDCDATA.
CLEAR WA_BDCDATA.
ENDFORM.
FORM BDC_FIELD USING FNAM FVAL.
WA_BDCDATA-FNAM = FNAM.
WA_BDCDATA-FVAL = FVAL.
APPEND WA_BDCDATA TO IT_BDCDATA.
CLEAR WA_BDCDATA.
ENDFORM.
input file :
OR 2148 0001235 R-1162 8 17
OR 2148 0001235 R-1161 2 30
OR 2148 0001235 100-400 6 25
OR 2148 0001235 R-1162 4 12
OR 2148 0001236 R-1162 3 12
OR 2148 0001236 R-1161 2 30
OR 2148 0001236 100-400 1 25
OR 2148 0001236 R-1162 7 12
OR 2148 0001236 R-1161 8 30
OR 2148 0001236 100-400 10 25
OR 2148 0001235 R-1161 5 30
OR 2148 0001235 100-400 2 25
OR 2148 0001235 R-11621 3 12
OR 2148 0001235 R-1161 2 30
OR 2148 0001235 100-400 1 25
OR 2148 0001235 R-1162 7 12
OR 2148 0001235 R-1161 8 30
OR 2148 0001235 100-400 10 25
OR 2148 0001236 R-1162 8 17
OR 2148 0001236 R-1161 2 30
OR 2148 0001236 100-400 6 25
OR 2148 0001236 R-1162 4 12
OR 2148 0001236 R-1161 5 30
OR 2148 0001236 100-400 2 25 -
How to find out the T-code of a program
Hi Experts,
I want to find out the T-codes of some programs. For that I am passing the program name in TSTC table and I am getting the T-code.
But TSTC table gives T-code for only main program and not for the includes. Is there any way to find out the T-codes for include programs also?
Thanks and regards,
VenkatHi,
there wont be tcodes for include programs....
u can find the tcode for a running program through Menu->system->status (now a window opens,here u can see transaction ie.,tcode).
Also when the program is not running,take se80 and put the program name,in the tree u can see the transaction attached.
Regards
Sajid -
I am using a code based typesetting program (not WYSISYG) that outputs PDFs. I am producing 100 plus pages that have multiple graphics on each page. I need to know how to format a PDF command that I can incllude in my programming that will tag my graphics with "Alternative Text".
I know that with a Microsoft product graphics can be tagged before a PDF is made. I need to know how to do this with my programming.The Acrobat SDK might be a starting point.
From there, perhaps a plug-in (built with C+).
Perhaps with a licensed release of a PDF Library (this could be $$).
The viable and cost effective alternative is use the tried and true.
Authoring in an appropriate authoring application with appropriate tag management.
Example: Adobe InDesign; Adobe FrameMaker or MS Word with PDFMaker (comes with install of Acrobat).
This way you place "Alternative Text" when mastering content in the authoring file.
Going the route and with some look-see (research) you may find programmatic approaches to placing the alt txt in the authoring file.
Note: as discussed in the Matterhorn Protocols there is no programmatic method that provides a fully accessible PDF (specifically, that is an ISO 14289-1, PDF/UA-1 compliant PDF).
Regardless, here you have a sub-forum for discussions on Acrobat usage.
Consequently discussions on/of 3rd party software is rather out of scope eh.
Be well... -
Schedule a job for traansaction code not for program
Hi All,
I have a TR Code for aprogram with a screen (not selection screen, not an executable program)
Can we schedule a job for SAP TR Code (not for program name);
Can you confirm this please
IverDear Iver,
You intend to execute that SAP Trxn code in background. You cannot schedule a job. Did you think in background who will populate the values in the screen?
Alternatively, you can create a BDC program & schedule that program.
BR,
Suhas -
Report for downloading the source code of a Program
Hi.
Need a code to download the source code of a Program in a text file and all the includes of that program in a separate coressponding files. <b>This should be with scan and read report statements.It should be with classe CL_GUI_FRONTEND_SERVICES but not with function modules.</b>
Thanks in advance.
Regards,
AshaHi Asha
Use the below program for your purpose.
Report: ZKBPROGS *
Function : Up/Download ABAP reports complete with texts *
Change Log : *
July 5, 1999 *
- Combined existing programs that did the upload and download into*
- one program. *
- Changed format that the reports are saved in to be compatible *
with Wolfgang Morgenthaler's upload/download program(YSTRASN00 *
at www.antarcon.de). Major differences between this program and*
Wolfgang's are:
- this program does not update TRDIR with the *
TRDIR entries that are in the program uploaded. Instead, *
current users stats are used. *
- this program allows selection of reports from a list or *
a single report can be tuped in and uploaded *
- this program also updates TADIR so that a development class*
is assigned to the program *
- this program checks to see if the program already has a *
TRDIR entry, and if it does, warns the user *
- this program will save/restore the program documenation too*
REPORT ZKBPROGS
NO STANDARD PAGE HEADING
LINE-SIZE 255.
Declare Database Objects *
tables:
DOKIL,
TRDIR.
Constants*
CONSTANTS:
MC_TRDIR_IDENTIFIER(72) TYPE C VALUE '%&%& RDIR',
MC_REPORT_IDENTIFIER(72) TYPE C VALUE '%&%& REPO',
MC_TEXT_IDENTIFIER(72) TYPE C VALUE '%&%& TEXP',
MC_THEAD_IDENTIFIER(72) TYPE C VALUE '%&%& HEAD',
MC_DOC_IDENTIFIER(72) TYPE C VALUE '%&%& DOKL',
MC_TRDIR_SHORT(4) TYPE C VALUE 'RDIR',
MC_REPORT_SHORT(4) TYPE C VALUE 'REPO',
MC_TEXT_SHORT(4) TYPE C VALUE 'TEXP',
MC_THEAD_SHORT(4) TYPE C VALUE 'HEAD',
MC_DOC_SHORT(4) TYPE C VALUE 'DOKP'.
Declare Module level data structures *
DATA: BEGIN OF MTAB_PROGRAM_SOURCE OCCURS 0,
LINE(72) TYPE C,
END OF MTAB_PROGRAM_SOURCE.
DATA: MTAB_PROGRAM_TRDIR LIKE TRDIR OCCURS 0 WITH HEADER LINE.
DATA: MTAB_PROGRAM_TEXTS LIKE TEXTPOOL OCCURS 0 WITH HEADER LINE.
DATA: MSTR_THEAD LIKE THEAD.
DATA: BEGIN OF MTAB_PROGRAM_FILE OCCURS 0,
LINE(275) TYPE C,
END OF MTAB_PROGRAM_FILE.
DATA: BEGIN OF MTAB_DIRECTORY OCCURS 0,
NAME LIKE TRDIR-NAME,
DESC(72) TYPE C,
SAVENAME LIKE RLGRAP-FILENAME,
END OF MTAB_DIRECTORY.
DATA: BEGIN OF MTAB_PROGRAM_DOCUMENTATION OCCURS 0,
LINE(255) TYPE C,
END OF MTAB_PROGRAM_DOCUMENTATION.
Selection Screen *
*-- Options for upload/download of programs
SELECTION-SCREEN BEGIN OF BLOCK FRM_OPTIONS WITH FRAME TITLE TEXT-UDL.
PARAMETERS:
RB_DOWN RADIOBUTTON GROUP UDL DEFAULT 'X'. " Download reports
SELECTION-SCREEN BEGIN OF BLOCK FRM_TRDIR WITH FRAME TITLE TEXT-DIR.
SELECT-OPTIONS:
S_NAME FOR TRDIR-NAME, " Program Name
S_SUBC FOR TRDIR-SUBC " Program Type
DEFAULT 'F' OPTION EQ SIGN E," Exclude Functions by default
S_CNAM FOR TRDIR-CNAM " Created by
DEFAULT SY-UNAME,
S_UNAM FOR TRDIR-UNAM, " Last Changed by
S_CDAT FOR TRDIR-CDAT, " Creation date
S_UDAT FOR TRDIR-UDAT. " Last update date
SELECTION-SCREEN END OF BLOCK FRM_TRDIR.
*-- Options for uploading programs
PARAMETERS:
RB_UP RADIOBUTTON GROUP UDL. " Upload reports
SELECTION-SCREEN BEGIN OF BLOCK FRM_UPLOAD WITH FRAME TITLE TEXT-UPL.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(29) TEXT-SNG.
PARAMETERS:
RB_FILE RADIOBUTTON GROUP HOW DEFAULT 'X'.
SELECTION-SCREEN COMMENT 33(42) TEXT-FNA.
SELECTION-SCREEN END OF LINE.
PARAMETERS:
RB_LIST RADIOBUTTON GROUP HOW.
SELECTION-SCREEN END OF BLOCK FRM_UPLOAD.
SELECTION-SCREEN END OF BLOCK FRM_OPTIONS.
*-- Options for up/downloading programs
SELECTION-SCREEN BEGIN OF BLOCK FRM_FILEN WITH FRAME TITLE TEXT-FIL.
PARAMETERS:
RB_DOS RADIOBUTTON GROUP FIL DEFAULT 'X', " Save to local
RB_UNIX RADIOBUTTON GROUP FIL, " Save to UNIX
P_PATH LIKE RLGRAP-FILENAME " Path to save files to
DEFAULT 'c:\temp\'.
SELECTION-SCREEN END OF BLOCK FRM_FILEN.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_NAME-LOW.
CALL FUNCTION 'F4_PROGRAM'
EXPORTING
OBJECT = S_NAME-LOW
SUPPRESS_SELECTION = 'X'
IMPORTING
RESULT = S_NAME-LOW
EXCEPTIONS
OTHERS = 1.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_NAME-HIGH.
CALL FUNCTION 'F4_PROGRAM'
EXPORTING
OBJECT = S_NAME-HIGH
SUPPRESS_SELECTION = 'X'
IMPORTING
RESULT = S_NAME-HIGH
EXCEPTIONS
OTHERS = 1.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_UNAM-LOW.
PERFORM GET_NAME USING 'S_UNAM-LOW'
CHANGING S_UNAM-LOW.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_UNAM-HIGH.
PERFORM GET_NAME USING 'S_UNAM-HIGH'
CHANGING S_UNAM-HIGH.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_CNAM-LOW.
PERFORM GET_NAME USING 'S_CNAM-LOW'
CHANGING S_CNAM-LOW.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_CNAM-HIGH.
PERFORM GET_NAME USING 'S_CNAM-HIGH'
CHANGING S_CNAM-HIGH.
TOP-OF-PAGE.
IF RB_LIST = 'X'.
FORMAT COLOR COL_HEADING.
NEW-LINE.
WRITE: AT 3 TEXT-H01,
AT 15 TEXT-H03.
FORMAT COLOR OFF.
ENDIF.
AT LINE-SELECTION.
CHECK RB_LIST = 'X'. " only do in list mode
READ LINE SY-CUROW FIELD VALUE MTAB_DIRECTORY-SAVENAME.
*-- Read file into an internal table
PERFORM READ_REPORT_FROM_DISK TABLES MTAB_PROGRAM_FILE
USING MTAB_DIRECTORY-SAVENAME.
*-- Split table into TADIR entry, report lines, and report text
PERFORM SPLIT_INCOMING_FILE TABLES MTAB_PROGRAM_FILE
MTAB_PROGRAM_SOURCE
MTAB_PROGRAM_TEXTS
MTAB_PROGRAM_DOCUMENTATION
CHANGING TRDIR
MSTR_THEAD.
*-- Save all of the data
PERFORM INSERT_NEW_REPORT TABLES MTAB_PROGRAM_SOURCE
MTAB_PROGRAM_TEXTS
MTAB_PROGRAM_DOCUMENTATION
USING TRDIR
MSTR_THEAD.
Start of processing *
START-OF-SELECTION.
FORMAT COLOR COL_NORMAL.
IF RB_DOWN = 'X'.
PERFORM DOWNLOAD_REPORTS.
ELSEIF RB_UP = 'X'.
PERFORM UPLOAD_REPORTS.
ENDIF.
END-OF-SELECTION.
IF RB_DOWN = 'X'.
CONCATENATE P_PATH
'directory.txt'
INTO P_PATH.
PERFORM SAVE_TABLE_TO_FILE TABLES MTAB_DIRECTORY
USING P_PATH.
ENDIF.
FORM UPLOAD_REPORTS *
FORM UPLOAD_REPORTS.
*-- Can upload a reports entered in selection criteria or
*-- select from a list. List can be from index.txt in same directory
*-- (created by the download) or by reading the first line of each file
*-- in the directory.
IF RB_FILE = 'X'. " Upload single program from a file
*-- Read file into an internal table
PERFORM READ_REPORT_FROM_DISK TABLES MTAB_PROGRAM_FILE
USING P_PATH.
*-- Split table into TADIR entry, report lines, and report text
PERFORM SPLIT_INCOMING_FILE TABLES MTAB_PROGRAM_FILE
MTAB_PROGRAM_SOURCE
MTAB_PROGRAM_TEXTS
MTAB_PROGRAM_DOCUMENTATION
CHANGING TRDIR
MSTR_THEAD.
*-- Save all of the data
PERFORM INSERT_NEW_REPORT TABLES MTAB_PROGRAM_SOURCE
MTAB_PROGRAM_TEXTS
MTAB_PROGRAM_DOCUMENTATION
USING TRDIR
MSTR_THEAD.
ELSEIF RB_LIST = 'X'. " Show list for user to choose from
*-- get list of report names/descriptions from directory text
CONCATENATE P_PATH
'directory.txt'
INTO P_PATH.
PERFORM READ_REPORT_FROM_DISK TABLES MTAB_DIRECTORY
USING P_PATH.
SORT MTAB_DIRECTORY.
*-- Write out list of report names/descriptions
LOOP AT MTAB_DIRECTORY.
WRITE:
/ MTAB_DIRECTORY-NAME UNDER TEXT-H01,
MTAB_DIRECTORY-DESC UNDER TEXT-H03,
MTAB_DIRECTORY-SAVENAME.
ENDLOOP.
*-- Process user selections for reports to upload.
ENDIF.
ENDFORM. " upload_reports
FORM DOWNLOAD_REPORTS *
From the user selections, get all programs that meet the *
criteria, and save them in ftab_program_directory. *
Also save the report to disk. *
FORM DOWNLOAD_REPORTS.
DATA:
LC_FULL_FILENAME LIKE RLGRAP-FILENAME.
*-- The table is put into an internal table because the program will
*-- abend if multiple transfers to a dataset occur within a SELECT/
*-- ENDSELCT (tested on 3.1H)
SELECT * FROM TRDIR
INTO TABLE MTAB_PROGRAM_TRDIR
WHERE NAME IN S_NAME
AND SUBC IN S_SUBC
AND CNAM IN S_CNAM
AND UNAM IN S_UNAM
AND CDAT IN S_CDAT
AND UDAT IN S_UDAT.
LOOP AT MTAB_PROGRAM_TRDIR.
*-- Clear out text and source code tables
CLEAR:
MTAB_PROGRAM_FILE,
MTAB_PROGRAM_SOURCE,
MTAB_PROGRAM_TEXTS,
MTAB_PROGRAM_DOCUMENTATION.
REFRESH:
MTAB_PROGRAM_FILE,
MTAB_PROGRAM_SOURCE,
MTAB_PROGRAM_TEXTS,
MTAB_PROGRAM_DOCUMENTATION.
*-- Get the report
READ REPORT MTAB_PROGRAM_TRDIR-NAME INTO MTAB_PROGRAM_SOURCE.
*-- Get the text for the report
READ TEXTPOOL MTAB_PROGRAM_TRDIR-NAME INTO MTAB_PROGRAM_TEXTS.
*-- Get the documentation for the report
CLEAR DOKIL.
SELECT * UP TO 1 ROWS FROM DOKIL
WHERE ID = 'RE'
AND OBJECT = MTAB_PROGRAM_TRDIR-NAME
AND LANGU = SY-LANGU
AND TYP = 'E'
ORDER BY VERSION DESCENDING.
ENDSELECT.
*-- Documentation exists for this object
IF SY-SUBRC = 0.
CALL FUNCTION 'DOCU_READ'
EXPORTING
ID = DOKIL-ID
LANGU = DOKIL-LANGU
OBJECT = DOKIL-OBJECT
TYP = DOKIL-TYP
VERSION = DOKIL-VERSION
IMPORTING
HEAD = MSTR_THEAD
TABLES
LINE = MTAB_PROGRAM_DOCUMENTATION
EXCEPTIONS
OTHERS = 1.
ENDIF.
*-- Put the report code and texts into a single file
*-- Put the identifier line in so that the start of the TRDIR line
*-- is marked
CONCATENATE MC_TRDIR_IDENTIFIER
MTAB_PROGRAM_TRDIR-NAME
INTO MTAB_PROGRAM_FILE-LINE.
APPEND MTAB_PROGRAM_FILE.
*-- Add the TRDIR line
MTAB_PROGRAM_FILE-LINE = MTAB_PROGRAM_TRDIR.
APPEND MTAB_PROGRAM_FILE.
*-- Put the identifier line in so that the start of the report code
*-- is marked
CONCATENATE MC_REPORT_IDENTIFIER
MTAB_PROGRAM_TRDIR-NAME
INTO MTAB_PROGRAM_FILE-LINE.
APPEND MTAB_PROGRAM_FILE.
*-- Add the report code
LOOP AT MTAB_PROGRAM_SOURCE.
MTAB_PROGRAM_FILE = MTAB_PROGRAM_SOURCE.
APPEND MTAB_PROGRAM_FILE.
ENDLOOP.
*-- Put the identifier line in so that the start of the report text
*-- is marked
CONCATENATE MC_TEXT_IDENTIFIER
MTAB_PROGRAM_TRDIR-NAME
INTO MTAB_PROGRAM_FILE-LINE.
APPEND MTAB_PROGRAM_FILE.
*-- Add the report texts
LOOP AT MTAB_PROGRAM_TEXTS.
MTAB_PROGRAM_FILE = MTAB_PROGRAM_TEXTS.
APPEND MTAB_PROGRAM_FILE.
ENDLOOP.
*-- Put the identifier line in so that the start of the THEAD record
*-- is marked
CONCATENATE MC_THEAD_IDENTIFIER
MTAB_PROGRAM_TRDIR-NAME
INTO MTAB_PROGRAM_FILE-LINE.
APPEND MTAB_PROGRAM_FILE.
MTAB_PROGRAM_FILE = MSTR_THEAD.
APPEND MTAB_PROGRAM_FILE.
*-- Put the identifier line in so that the start of the report
*-- documentation is marked
CONCATENATE MC_DOC_IDENTIFIER
MTAB_PROGRAM_TRDIR-NAME
INTO MTAB_PROGRAM_FILE-LINE.
APPEND MTAB_PROGRAM_FILE.
*-- Add the report documentation
LOOP AT MTAB_PROGRAM_DOCUMENTATION.
MTAB_PROGRAM_FILE = MTAB_PROGRAM_DOCUMENTATION.
APPEND MTAB_PROGRAM_FILE.
ENDLOOP.
*-- Make the fully pathed filename that report will be saved to
CONCATENATE P_PATH
MTAB_PROGRAM_TRDIR-NAME
'.txt'
INTO LC_FULL_FILENAME.
PERFORM SAVE_TABLE_TO_FILE TABLES MTAB_PROGRAM_FILE
USING LC_FULL_FILENAME.
*-- Write out message with Program Name/Description
READ TABLE MTAB_PROGRAM_TEXTS WITH KEY ID = 'R'.
IF SY-SUBRC = 0.
MTAB_DIRECTORY-NAME = MTAB_PROGRAM_TRDIR-NAME.
MTAB_DIRECTORY-DESC = MTAB_PROGRAM_TEXTS-ENTRY.
MTAB_DIRECTORY-SAVENAME = LC_FULL_FILENAME.
APPEND MTAB_DIRECTORY.
WRITE: / MTAB_PROGRAM_TRDIR-NAME,
MTAB_PROGRAM_TEXTS-ENTRY(65) COLOR COL_HEADING.
ELSE.
MTAB_DIRECTORY-NAME = MTAB_PROGRAM_TRDIR-NAME.
MTAB_DIRECTORY-DESC = 'No description available'.
MTAB_DIRECTORY-SAVENAME = LC_FULL_FILENAME.
APPEND MTAB_DIRECTORY.
WRITE: / MTAB_PROGRAM_TRDIR-NAME.
ENDIF.
ENDLOOP.
ENDFORM. " BUILD_PROGRAM_DIRECTORY
FORM SAVE_TABLE_TO_FILE *
--> FTAB_TABLE *
--> F_FILENAME *
FORM SAVE_TABLE_TO_FILE TABLES FTAB_TABLE
USING F_FILENAME.
IF RB_DOS = 'X'. " Save file to presentation server
CALL FUNCTION 'WS_DOWNLOAD'
EXPORTING
FILENAME = F_FILENAME
FILETYPE = 'ASC'
TABLES
DATA_TAB = FTAB_TABLE
EXCEPTIONS
OTHERS = 4.
IF SY-SUBRC NE 0.
WRITE: / 'Error opening dataset' COLOR COL_NEGATIVE,
F_FILENAME COLOR COL_NEGATIVE.
ENDIF.
ELSE. " Save file to application server
OPEN DATASET F_FILENAME FOR OUTPUT IN TEXT MODE.
IF SY-SUBRC = 0.
LOOP AT FTAB_TABLE.
TRANSFER FTAB_TABLE TO F_FILENAME.
IF SY-SUBRC NE 0.
WRITE: / 'Error writing record to file;' COLOR COL_NEGATIVE,
F_FILENAME COLOR COL_NEGATIVE.
ENDIF.
ENDLOOP.
ELSE.
WRITE: / 'Error opening dataset' COLOR COL_NEGATIVE,
F_FILENAME COLOR COL_NEGATIVE.
ENDIF.
ENDIF. " End RB_DOS
ENDFORM. " SAVE_PROGRAM
FORM READ_REPORT_FROM_DISK *
Read report into internal table. Can read from local or *
remote computer *
FORM READ_REPORT_FROM_DISK TABLES FTAB_TABLE
USING F_FILENAME.
DATA:
LC_MESSAGE(128) TYPE C.
CLEAR FTAB_TABLE.
REFRESH FTAB_TABLE.
IF RB_DOS = 'X'.
TRANSLATE F_FILENAME USING '/\'. " correct slash for Dos PC file
CALL FUNCTION 'WS_UPLOAD'
EXPORTING
FILENAME = F_FILENAME
FILETYPE = 'ASC'
TABLES
DATA_TAB = FTAB_TABLE
EXCEPTIONS
CONVERSION_ERROR = 1
FILE_OPEN_ERROR = 2
FILE_READ_ERROR = 3
INVALID_TABLE_WIDTH = 4
INVALID_TYPE = 5
NO_BATCH = 6
UNKNOWN_ERROR = 7
OTHERS = 8.
IF SY-SUBRC >< 0.
WRITE: / 'Error reading file from local PC' COLOR COL_NEGATIVE.
ENDIF.
ELSEIF RB_UNIX = 'X'.
TRANSLATE F_FILENAME USING '\/'. " correct slash for unix
OPEN DATASET F_FILENAME FOR INPUT MESSAGE LC_MESSAGE IN TEXT MODE.
IF SY-SUBRC = 0.
DO.
READ DATASET F_FILENAME INTO FTAB_TABLE.
IF SY-SUBRC = 0.
APPEND FTAB_TABLE.
ELSE.
EXIT.
ENDIF.
ENDDO.
CLOSE DATASET F_FILENAME.
ELSE.
WRITE: / 'Error reading file from remote computer'
COLOR COL_NEGATIVE,
/ LC_MESSAGE,
/ F_FILENAME.
SY-SUBRC = 4.
ENDIF.
ENDIF.
ENDFORM. " READ_REPORT_FROM_DISK
FORM SPLIT_INCOMING_FILE *
--> FTAB_PROGRAM_FILE *
--> FTAB_PROGRAM_SOURCE *
--> ` *
--> FTAB_PROGRAM_TEXTS *
FORM SPLIT_INCOMING_FILE TABLES FTAB_PROGRAM_FILE
STRUCTURE MTAB_PROGRAM_FILE
FTAB_PROGRAM_SOURCE
STRUCTURE MTAB_PROGRAM_SOURCE
FTAB_PROGRAM_TEXTS
STRUCTURE MTAB_PROGRAM_TEXTS
FTAB_PROGRAM_DOCUMENTATION
STRUCTURE MTAB_PROGRAM_DOCUMENTATION
CHANGING FSTR_TRDIR
FSTR_THEAD.
DATA:
LC_DATATYPE(4) TYPE C, " Type of data, REPO, TEXP, RDIR
LC_PROGRAM_FILE LIKE MTAB_PROGRAM_FILE.
LOOP AT FTAB_PROGRAM_FILE.
LC_PROGRAM_FILE = FTAB_PROGRAM_FILE.
CASE LC_PROGRAM_FILE(9).
WHEN MC_TRDIR_IDENTIFIER.
LC_DATATYPE = MC_TRDIR_SHORT.
WHEN MC_REPORT_IDENTIFIER.
LC_DATATYPE = MC_REPORT_SHORT.
WHEN MC_TEXT_IDENTIFIER.
LC_DATATYPE = MC_TEXT_SHORT.
WHEN MC_DOC_IDENTIFIER.
LC_DATATYPE = MC_DOC_SHORT.
WHEN MC_THEAD_IDENTIFIER.
LC_DATATYPE = MC_THEAD_SHORT.
WHEN OTHERS. " Actual contents of report, trdir, or text
CASE LC_DATATYPE.
WHEN MC_TRDIR_SHORT.
FSTR_TRDIR = FTAB_PROGRAM_FILE.
WHEN MC_REPORT_SHORT.
FTAB_PROGRAM_SOURCE = FTAB_PROGRAM_FILE.
APPEND FTAB_PROGRAM_SOURCE.
WHEN MC_TEXT_SHORT.
FTAB_PROGRAM_TEXTS = FTAB_PROGRAM_FILE.
APPEND FTAB_PROGRAM_TEXTS.
WHEN MC_THEAD_SHORT.
FSTR_THEAD = FTAB_PROGRAM_FILE.
WHEN MC_DOC_SHORT.
FTAB_PROGRAM_DOCUMENTATION = FTAB_PROGRAM_FILE.
APPEND FTAB_PROGRAM_DOCUMENTATION.
ENDCASE.
ENDCASE.
ENDLOOP.
ENDFORM. " SPLIT_INCOMING_FILE
FORM INSERT_NEW_REPORT*
--> FTAB_PROGRAM_SOURCE *
--> FTAB_PROGRAM_TEXTS *
--> F_TRDIR *
FORM INSERT_NEW_REPORT TABLES FTAB_PROGRAM_SOURCE
STRUCTURE MTAB_PROGRAM_SOURCE
FTAB_PROGRAM_TEXTS
STRUCTURE MTAB_PROGRAM_TEXTS
FTAB_PROGRAM_DOCUMENTATION
STRUCTURE MTAB_PROGRAM_DOCUMENTATION
USING FSTR_TRDIR LIKE TRDIR
FSTR_THEAD LIKE MSTR_THEAD.
DATA:
LC_OBJ_NAME LIKE E071-OBJ_NAME,
LC_LINE2(40) TYPE C,
LC_ANSWER(1) TYPE C.
*-- read trdir to see if the report already exists, if it does, prompt
*-- user to overwrite or abort.
SELECT SINGLE * FROM TRDIR WHERE NAME = FSTR_TRDIR-NAME.
IF SY-SUBRC = 0. " Already exists
CONCATENATE 'want to overwrite report'
FSTR_TRDIR-NAME
INTO LC_LINE2 SEPARATED BY SPACE.
CONCATENATE LC_LINE2
INTO LC_LINE2.
CALL FUNCTION 'POPUP_TO_CONFIRM_STEP'
EXPORTING
DEFAULTOPTION = 'N'
TEXTLINE1 = 'The selected report already exists, do you'
TEXTLINE2 = LC_LINE2
TITEL = 'Report already exists'
CANCEL_DISPLAY = SPACE
IMPORTING
ANSWER = LC_ANSWER
EXCEPTIONS
OTHERS = 1.
ELSE.
LC_ANSWER = 'J'.
ENDIF.
IF LC_ANSWER = 'J'.
*-- Create the TADIR entry. (TRDIR entry created by INSERT REPORT)
LC_OBJ_NAME = TRDIR-NAME.
CALL FUNCTION 'TR_TADIR_POPUP_ENTRY_E071'
EXPORTING
WI_E071_PGMID = 'R3TR'
WI_E071_OBJECT = 'PROG'
WI_E071_OBJ_NAME = LC_OBJ_NAME
WI_TADIR_DEVCLASS = '$TMP'
EXCEPTIONS
EXIT = 3
OTHERS = 4.
IF SY-SUBRC = 0.
*-- Create Report
INSERT REPORT FSTR_TRDIR-NAME FROM FTAB_PROGRAM_SOURCE.
*-- Create Texts
INSERT TEXTPOOL FSTR_TRDIR-NAME FROM FTAB_PROGRAM_TEXTS
LANGUAGE SY-LANGU.
*-- Save Documentation
CALL FUNCTION 'DOCU_UPDATE'
EXPORTING
HEAD = FSTR_THEAD
STATE = 'A'
TYP = 'E'
VERSION = '1'
TABLES
LINE = FTAB_PROGRAM_DOCUMENTATION
EXCEPTIONS
OTHERS = 1.
ELSE.
WRITE: / 'Error updating the TADIR entry' COLOR COL_NEGATIVE,
'Program' COLOR COL_NEGATIVE INTENSIFIED OFF,
FSTR_TRDIR-NAME, 'was not loaded into SAP.'
COLOR COL_NEGATIVE INTENSIFIED OFF.
ENDIF.
ELSE.
WRITE: / FSTR_TRDIR-NAME COLOR COL_NEGATIVE,
'was not uploaded into SAP. Action cancelled by user'
COLOR COL_NEGATIVE INTENSIFIED OFF.
ENDIF.
ENDFORM. " INSERT_NEW_REPORT
FORM GET_NAME *
--> VALUE(F_FIELD) *
--> F_NAME *
FORM GET_NAME USING VALUE(F_FIELD)
CHANGING F_NAME.
DATA: LTAB_FIELDS LIKE DYNPREAD OCCURS 0 WITH HEADER LINE,
LC_PROG LIKE D020S-PROG,
LC_DNUM LIKE D020S-DNUM.
TRANSLATE F_FIELD TO UPPER CASE.
refresh ltab_fields.
LTAB_FIELDS-FIELDNAME = F_FIELD.
append ltab_fields.
LC_PROG = SY-REPID .
LC_DNUM = SY-DYNNR .
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
DYNAME = LC_PROG
DYNUMB = LC_DNUM
TABLES
dynpfields = ltab_fields
EXCEPTIONS
OTHERS = 01.
read table ltab_fields index 1.
IF SY-SUBRC EQ 0.
F_NAME = LTAB_FIELDS-FIELDVALUE.
refresh ltab_fields.
ENDIF.
CALL FUNCTION 'F4_USER'
EXPORTING
OBJECT = F_NAME
IMPORTING
RESULT = F_NAME.
ENDFORM. " GET_NAME
Regards,
Sree -
To Find the SAP Query from the tranaction code or the program name
Hi,
I have a situation wherein I have to modify the sap query associated with an transaction code.But the problem is that I am unable to find the SAP Query.
<b>Please let me know how to find the SAP query from the transaction code or the program name.</b>
Thanks and Regards,
RupeshHi Rupesh,
1 use FM
RSAQ_DECODE_REPORT_NAME
2. This is one of the best and easiest way.
3. It will provide u the following info.
WORKSPACE
USERGROUP
QUERY
CLIENT
4. Thru TCode U must know the program name first.
This can be discovered using SE93.
Hope it helps.
Regards,
Amit M. -
How can I view the code of a program in a browser?
For example, is it possible for me to see the code of this program:
http://cisweb.mwcc.edu/st01/robertscourseversion2/runapplet.htm
Sorry, I know this is a dumb question, I just started to learn Java.In general, no. The applet you see is contained in one or more .class files -
possibly contained in a .jar file. There may also be other files (resources)
that the applet is using.
If you go to that page and look at the .html source (browsers will let you do this)
you see:<html>
<body>
<applet code = ClassApplet.class
width = 400
height = 400>
</applet>
</body>
</html>In this case it appears that at least one of the files involved can be obtained
from the url http://cisweb.mwcc.edu/st01/robertscourseversion2/ClassApplet.class
It is possible to "reconstruct" the source (search the fabulous web for
"Java Decompiler"). And this source may well lead you other classes and
resources that are being used.*
There may be legal restrictions on what you can and can't do with stuff that's
made publically accessible on the internet. (I'm no lawyer.)
* In the course of writing this I downloaded JAD - a common java decompiler -
and ran it on this class file. There seem to be no other .class files being
referenced within it. -
Can anyone help me wid d codes for Generated Program for gate pass
can anyone help me wid d codes for Generated Program for gate pass in MM
Message was edited by:
Ronei ShediHi
There is no std business process in SAP for Gate pass for the Material entry
before GR stock entry into the stores.
You have to write a Z program based on the details of Purchase order tables EKKO and EKPO.
This will mainly check whether the correct PO qty was delivered or not with proper quality.
So use the PO tables EKKO and EKPO and fetch the data and use it
Since this is client specific there is no feneralised program for it.
Reward points if useful
Regards
Anji -
While Installing this error is coming This Program can not display the pag
When I Try to Install SAP B1 8.8 on Win server 2008.
I am receiving this message.
This Program can not display the page
The website is encountering Problem
There might be a typing error in the address
At the time of Installation which site we need to access.
My Internet is working.
Still i am facing this Problem please suggest me what should I do.HI Ram ,
Internet is not required while Installation .
Go through :
Re: SAP Business Installation
Thanks
Ashish -
Layout - This Program can not display the webpage
Hi Experts,
I am trying to create adobe forms in Webdynpro ABAP, for that I created a Webdynpro component and then view in it and created the required attributes and nodes and the pdfsource as xstring type.
When I go to Layout tab it showing "This Program can not display the webpage" and in route element container I created an element and gave as of Interactive forms but the system is not creating any interface nor going into adobe live cycle designer.
Is it the problem with the Live Cycle Designer or what exactly I have to do now.
Please help me out.
Thanks,
PraveenHi.,
This seems that u didnt maintained host entries.,
Click Run -> enter drivers -> goto etc folder -> double click on hosts file -> open with note pad.
there u need to enter the host entries., like .. 192.....<server_address> <tab> <domain> <tab> <host>
ask ur basis team., they will configure that..,
hope this helps u.,
reply if u need some more clarifications.,
Thanks & Regards
Kiran
Maybe you are looking for
-
I own the suit of Adobe Programs which I have been using for years. They are paid for and registered and I have serial numbers. Today, I cannot open the programs. The message is: Design and Web Premium Trial. Expired. I do not want to use CC. I
-
I am doing some file migration for a client, using SharePoint 2013 on prem. Whether copying files from a local or network drive, to a Document Library, or from Document Library to other Document Library, I want the option of preserving file dates and
-
This is a big headache having the pentool respond this way. Does anyone else have this problem? I have also installed CC 2014 on my home computer and have the same problem. so it seems to be a problem with the program.
-
friends, I would like to know if there are any standard reports which can give me the list of infocubes which are not compressed yet. If there are none can any one give me steps to achieve this or if any ABAP code to be written to extract this inform
-
Regarding button in selection screen
Hi all, A query... After clicking the button on the screen, when i press the execute button it should give a display saying the corresponding button i clicked.... But its not working out frnds... tables sscrfields. data flag. parameters test. selecti