How to get correct format in file at Application server
Hi,
I am retrieving data MATNR,MAKTX,VENDOR,VENDOR NAME,PRODUCT HIERARCHY,QUANTITY(LABST),BUDAT.
I am downloading the data into .xls file in both presentation and application server.
In presentation I am getting correct format.
Where as in application server I am not getting proper format.
Quantity(MARD-LABST) is not coming proprely.(###6## instead of 36)
How to get it in correct forma?I
symbol means Space
Before transfer the data to File..
condense MARD-LABST and then transfer it.
I guess you are using charcter field LABST while transferring the data to file.
Do not use quantity field directly,please move it to charcter field then condense it.
Thanks
Seshu
Similar Messages
-
How to get the list of file from application server
Hi Expert.
I want to get the file list from dicrectory in application server
best regards.
AlexHi.
Yes, You are right, i can get the file list by AL11.
But i need get the list in ABAP program.
So i need a function modul to get the list. If you has some sample code, it should be very nice.
Best.
Alex -
How to Provide search Help for files on Application Server
Hi Guys,
Can anyone tell me How to Provide search Help for files on Application Server. I have put a file name on selection screen. I want to give search help for files on application server.
Thanks & Regards.
Harish.Hi Harish,
Use the following code,
tables sxpgcotabe.
data: lt_execprot LIKE btcxpm OCCURS 0 WITH HEADER LINE,
w_filepath(60) TYPE c, --> length depending on your Directory path.
SELECT SINGLE *
FROM sxpgcotabe
WHERE name = 'LIST_DB2DUMP'
AND opsystem = sy-opsys.
IF sy-subrc <> 0.
SELECT SINGLE *
FROM sxpgcotabe
WHERE name = 'LIST_DB2DUMP'
AND opsystem = 'UNIX'.
IF sy-subrc <> 0.
MESSAGE e000 WITH 'External operating system command '
'LIST_DB2DUMP not found'.
ENDIF.
ENDIF.
sxpgcotabe-parameters = p_filepath. --> provide the directory path.
CALL FUNCTION 'SXPG_COMMAND_EXECUTE'
EXPORTING
commandname = sxpgcotabe-name
additional_parameters = sxpgcotabe-parameters
operatingsystem = sxpgcotabe-opsystem
TABLES
exec_protocol = lt_execprot
EXCEPTIONS
no_permission = 1
command_not_found = 2
parameters_too_long = 3
security_risk = 4
wrong_check_call_interface = 5
program_start_error = 6
program_termination_error = 7
x_error = 8
parameter_expected = 9
too_many_parameters = 10
illegal_command = 11
wrong_asynchronous_parameters = 12
cant_enq_tbtco_entry = 13
jobcount_generation_error = 14
OTHERS = 15.
IF sy-subrc <> 0.
MESSAGE e000 WITH text-e01 p_filepath. "Directory failed
ENDIF.
Loop round the directory list, split each line up into a line table
and get the last data for each line, should be the filename
Then build the dirlist.
REFRESH t_dirlist.
LOOP AT lt_execprot.
REFRESH t_dirline.
SPLIT lt_execprot-message AT space INTO TABLE t_dirline.
DESCRIBE TABLE t_dirline LINES w_nolines.
READ TABLE t_dirline INDEX w_nolines.
MOVE t_dirline-data TO t_dirlist-filename.
APPEND t_dirlist.
ENDLOOP.
Here you will get all the files in the directory mentioned in Application server.
For displaying them as a Search help use the FM '/BMC/ZPOPUP_GET_VALUE'
Pass the Internal table to this FM.
Regards,
Paul. -
How to know the first placed file in Application server directory
Hi All ,
i want to Know the First plased file in a application server directory . i have tried with
FM EPS_GET_FILE_ATTRIBUTES but it is giving the file size. Can anybody give some idea to get the file lastmodify property.
Thanks & Regards
Prithvi.Hi Prithvi!
Use the methods of class CL_GUI_FRONTEND_SERVICES (if your release is at least 620, sorry otherwise).
Method DIRECTORY_LIST_FILES will give you all files of a directory, then you can check with method FILE_GET_ATTRIBUTES for some date info.
But maybe you can agree about a timestamp in the filename - this has to be set by the sender, but is much easier and reliable, too.
Regards,
Christian -
How System Command can replace a file in Application Server
Hi Guys,
A new system Command is created. When that system command is executed, the client wants to take a file from one directory in application server and put that file into another directory on the application server itself. How this can be achieved?
What I know is we can create a function module and place that function module in the system command. But in that function module, I have to change the fielname and put that into another directory. I don't know how to do it.
Note: I shouldn't read the data from the file using Open Dataset statements..
Please let me the solution if any one has encountered such a scenario.
Regards.
Hari.I think you are mixing up things here.
The program "sapiconv" is for converting files into different codepages, it´s not for copying/moving files to other directories.
If you want to use the ZSAPICONV to you need to modify it, take out the "sapiconv" and put in the "mv" (move) command to move the file to the other directory.
I suggest though creating a NEW command. e.g ZMV and give the appropriate parameters.
Markus -
Error when loading a flat file from Application server.
Hi,
I am trying to load a flatfile from the application server, and I am getting the message
Error while accessing the application server file
Message no. RSDS_ACCESS002
I checked for notes and found only one:
Note 1033978 - Correction: Loading Unicode files from application server
but we have 19 SP level, and the note says it needs 13 SP level, so I think it would not be of any help.
does anybodie know what to do??
thanks for the help.
MauricioError in accessing while application server file..
when i am trying load the data to psa
when i am taking the file name: text-type file from app server
plz reslove me for this problem??
another question
when i am saving the file with using * in the filename in .CSV file its not saving,
whats the reason????
ASHOK -
I want to put header while stroing file in application server
Hi Guru,
Can anybody tell how to put header while stroing file in application server.
in the below pgm data is coming i want to put heading .if we see in al11 transaction the header should come .plese give on eg in the code itself.its urgent
eg:
material number
100
200
declarations...................................................
tables: bkpf. " Accounting Document Header
*"Selection screen elements............................................
parameters:
p_burks like bkpf-bukrs. " Company Code
select-options:
s_gjahr for bkpf-gjahr. " Fiscal year
Type declaration of the structure to hold Accounting Document Header*
data:
begin of fs_bkpf,
bukrs type bkpf-bukrs, " Company Code
belnr type bkpf-belnr, " Accounting Document Number
gjahr type bkpf-gjahr, " Fiscal year
blart type bkpf-blart, " Document type
bldat type bkpf-bldat, " Document date in document
end of fs_bkpf.
Internal table to hold Accounting Document Header *
data:
t_bkpf like standard table
of fs_bkpf.
Type declaration of the structure to hold file data *
data:
begin of fs_table,
str type string,
end of fs_table.
Internal table to hold file data *
data:
t_table like standard table
of fs_table.
field-symbols: <fs>.
*" Data declarations...................................................
Work variables *
data:
w_char(50) type c,
w_file_name(50) type c value 'YH645_050103'.
select bukrs " Company Code
belnr " Accounting Document Number
gjahr " Fiscal year
blart " Document type
bldat " Document date in document
from bkpf
into table t_bkpf
where bukrs eq p_burks
and gjahr in s_gjahr.
if sy-subrc eq 0.
loop at t_bkpf into fs_bkpf.
do.
assign component sy-index of structure fs_bkpf to <fs>.
if sy-subrc ne 0.
exit.
else.
move <fs> to w_char.
if sy-index eq 1.
fs_table-str = <fs>.
else.
concatenate fs_table-str ',' w_char into fs_table-str.
endif. " IF SY-INDEX...
endif. " IF SY-SUBRC...
enddo. " DO...
append fs_table to t_table.
endloop. " LOOP AT T_KNA1...
endif. " IF SY-SUBRC...
open dataset w_file_name for output in text mode encoding default.
loop at t_table into fs_table.
transfer fs_table-str to w_file_name.
endloop. " LOOP AT T_TABLE...Hi,
may i know what kind of heading you want to display?
like date, filename, time etc
then modify the below code:
*& Form send_statistic
Create the status Report on application Server
---> pv_rlines - Total No of Records in Internal table *
---> pv_slines - Total No of Successful records *
---> pv_elines - Total No of Errornous records *
---> pv_path - File Path where the file to be created *
---> pv_flag - Flag to check for A/c group *
FORM sub_send_statistic USING pv_rlines TYPE int4
pv_slines TYPE int4
pv_elines TYPE int4
pv_path TYPE salfile-longname
pv_name TYPE rlgrap-filename
pv_flag TYPE char1.
CLEAR : i_tab,
wa_tab.
Convert date to MM/DD/YYYY format
PERFORM date_convert.
Convert Time to HH:MM:SS format
CONCATENATE sy-uzeit+0(2)
c_colon
sy-uzeit+2(2)
c_colon
sy-uzeit+4(2)
INTO v_time1.
Build the Output File name
IF p_sold = c_x
AND pv_flag = c_x.
CONCATENATE c_objid
c_us
c_z001
c_us
sy-datum
c_us
sy-uzeit
INTO v_file.
ENDIF. " IF p_sold = c_x
IF p_cons = c_x.
CONCATENATE c_objid
c_us
c_z008
c_us
sy-datum
c_us
sy-uzeit
INTO v_file.
ELSEIF p_sold = c_x
AND pv_flag <> c_x.
CONCATENATE c_objid
c_us
sy-datum
c_us
sy-uzeit
INTO v_file.
ENDIF. " IF p_cons = c_x
Build the Complete Output File Path
CONCATENATE pv_path
c_slash
v_file
INTO v_outfile.
Populate the data required for output into an internal table and
then transfer the table contents to file on application server
DATA UPLOAD STATISTICS
wa_tab-rec = text-001.
APPEND wa_tab TO i_tab.
CLEAR wa_tab.
TITLE
IF p_sold = c_x
AND pv_flag <> c_x.
sy-title = text-t17.
ENDIF. " IF p_sold = c_x
IF p_sold = c_x
AND pv_flag = c_x.
sy-title = text-t16.
ENDIF. " IF p_sold = c_x
IF p_cons = c_x
AND pv_flag = c_x.
sy-title = text-t19.
ENDIF. " IF p_cons = c_x
wa_tab-rec+0(7) = text-002.
wa_tab-rec+7(60) = sy-title.
APPEND wa_tab TO i_tab.
CLEAR wa_tab.
Date & Time
wa_tab-rec+0(5) = text-012.
CONDENSE v_date NO-GAPS.
wa_tab-rec+6(10) = v_date.
wa_tab-rec+60(10) = text-003.
wa_tab-rec+70(15) = v_time1.
APPEND wa_tab TO i_tab.
CLEAR wa_tab.
Folder Name
wa_tab-rec+0(18) = text-005.
wa_tab-rec+19(72) = pv_path.
APPEND wa_tab TO i_tab.
CLEAR wa_tab.
File Name
wa_tab-rec+0(18) = text-006.
---Begin of addition -Shivakumar - 09-05-2007--
wa_tab-rec+19(72) = pv_name.
---Begin of addition -Shivakumar - 09-05-2007--
APPEND wa_tab TO i_tab.
CLEAR wa_tab.
Records Read
CLEAR v_count.
v_data = pv_rlines.
v_count = STRLEN( v_data ).
CONDENSE v_data NO-GAPS.
wa_tab-rec+0(46) = text-007.
wa_tab-rec+47(4) = v_data.
APPEND wa_tab TO i_tab.
CLEAR : wa_tab,
v_data.
Successfull Records
CLEAR v_count.
v_data = pv_slines.
v_count = STRLEN( v_data ).
CONDENSE v_data NO-GAPS.
wa_tab-rec+0(46) = text-008.
wa_tab-rec+47(4) = v_data.
APPEND wa_tab TO i_tab.
CLEAR : wa_tab,
v_data.
Error Records
CLEAR v_count.
v_data = pv_elines.
v_count = STRLEN( v_data ).
CONDENSE v_data NO-GAPS.
wa_tab-rec+0(46) = text-009.
wa_tab-rec+47(4) = v_data.
APPEND wa_tab TO i_tab.
CLEAR : wa_tab,
v_data.
v_mesg = text-t04.
IF p_sold = c_x
AND pv_flag <> c_x.
MOVE i_tab TO i_file.
ENDIF. " IF p_sold = c_x
IF p_sold = c_x
AND pv_flag = c_x.
MOVE i_tab TO i_file1.
ENDIF. " IF p_sold = c_x
IF NOT i_tab IS INITIAL.
Open the file on Application server to write the report
OPEN DATASET v_outfile
FOR OUTPUT IN TEXT MODE
ENCODING DEFAULT MESSAGE v_mesg.
IF sy-subrc <> 0.
MESSAGE e000(zconversions) WITH v_mesg.
ELSE. " IF sy-subrc <> 0
Transfer details to the file on application server
CLEAR wa_tab.
LOOP AT i_tab INTO wa_tab.
TRANSFER wa_tab-rec TO v_outfile.
CLEAR wa_tab.
ENDLOOP. " LOOP AT i_tab INTO wa_tab
Close the file
CLOSE DATASET v_outfile.
ENDIF. " IF sy-subrc <> 0
ENDIF. " IF NOT i_tab IS INITIAL
ENDFORM. " Create_Report -
Sending EMail "Text-File" from Application Server!
Hi Experts,
how can I sending a Text-File from Application Server via Email?
Is there existing a Function Modul?
With Kind regards
Ersin
Moderator message: sending emails = FAQ, please search before posting.
Edited by: Thomas Zloch on Nov 25, 2010 4:23 PMSTF (Search the forum)! This type of question has been asked...and answered....many times.
-
How to get Date Format from Local Object.
Hi All,
I am new to Web Channel.
I need to know Date format From date of locale.
suppose there is a date "01/25/2010" date in date field I want to get string "mm/dd/yyyy". Actually I have to pass date format to backend when I call RFC.
Is there any way to get Date format from "Locale" object. I should get date format for local object
I get local object from "UserSessionData" object but how to get Date format from it.
I am not looking for Date value. I am looking for current local date format ("mm/dd/yyyy or dd/mm/yyyy or mon/dd/yyyy) whatever local date format. I could not find example which show how to get date format from "Locale" object.
Any help will be appreciated with rewards.
Regards.
Web ChannelHi,
You can get it from "User" or "Shop" business object.
Try to get User or Shop Business Object as shown below.
BusinessObjectManager bom = (BusinessObjectManager) userSessionData.getBOM(BusinessObjectManager.ISACORE_BOM);
User user = bom.getUser();
char decimalNotation = user.getDecimalPointFormat().getGroupingSeparator();
If you are seeing "1,234.00" then above code will return "."
I hope this information help you to resolve your issue.
eCommerce Developer. -
How to get the most current file based on date and time stamp using SSIS?
Hello,
Let us assume that files get copied in a specific directory. We need to pick up a file and load data. Can you guys let me know how to get the most current file based on date and time stamp using SSIS?
Thanks
thx regards dinesh vvhi simon
i excuted this script it is giving error..
Microsoft SQL Server Integration Services Script Task
Write scripts using Microsoft Visual C# 2008.
The ScriptMain is the entry point class of the script.
using System;
using System.Data;
using Microsoft.SqlServer.Dts.Runtime;
using System.Windows.Forms;
namespace ST_9a6d985a04b249c2addd766b58fee890.csproj
[System.AddIn.AddIn("ScriptMain", Version = "1.0", Publisher = "", Description = "")]
public partial class ScriptMain : Microsoft.SqlServer.Dts.Tasks.ScriptTask.VSTARTScriptObjectModelBase
#region VSTA generated code
enum ScriptResults
Success = Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Success,
Failure = Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Failure
#endregion
The execution engine calls this method when the task executes.
To access the object model, use the Dts property. Connections, variables, events,
and logging features are available as members of the Dts property as shown in the following examples.
To reference a variable, call Dts.Variables["MyCaseSensitiveVariableName"].Value;
To post a log entry, call Dts.Log("This is my log text", 999, null);
To fire an event, call Dts.Events.FireInformation(99, "test", "hit the help message", "", 0, true);
To use the connections collection use something like the following:
ConnectionManager cm = Dts.Connections.Add("OLEDB");
cm.ConnectionString = "Data Source=localhost;Initial Catalog=AdventureWorks;Provider=SQLNCLI10;Integrated Security=SSPI;Auto Translate=False;";
Before returning from this method, set the value of Dts.TaskResult to indicate success or failure.
To open Help, press F1.
public void Main()
string file = Dts.Variables["User::FolderName"].Value.ToString();
string[] files = System.IO.Directory.GetFiles(Dts.Variables["User::FolderName"].Value.ToString());
System.IO.FileInfo finf;
DateTime currentDate = new DateTime();
string lastFile = string.Empty;
foreach (string f in files)
finf = new System.IO.FileInfo(f);
if (finf.CreationTime >= currentDate)
currentDate = finf.CreationTime;
lastFile = f;
Dts.Variables["User::LastFile"].Value = lastFile;
Dts.TaskResult = (int)ScriptResults.Success;
thx regards dinesh vv -
How to get OGG format in Logic Studio
How to get OGG format in Logic Studio
Presumably you can convert it to Wav, AIFF or other compatible format using a suitable conversion program (at a guess) - there are convertors to do it the other way round anyway!
-
How to get the number of files currently open?
hi,
does any one know how to get the number of files currently open in windows OS?
e.g. lets say .txt files...
any comment will be really appreciated.
thanksAssuming that you don't want to actually do this from within Java code (which would obviously require native code), here's a utility that will give you a list of which file handles are opened by which processes (on Windows):
http://www.sysinternals.com/ntw2k/freeware/handle.shtml
- K -
How to get the current executing file/itself absolute directory?
hellooo,
gentlemen/lady, how to get the current executing file/itself absolute directory?
thanks
Hello,
you can get the real path information of the JSP through the servlet context:
http://java.sun.com/products/servlet/2.2/javadoc/index.html
javax.servlet
Interface ServletContext
Method getRealPath
Christian Plenagl
Developer Relations Engineer
BEA Support
[email protected] (alex mok) wrote:
>hellooo,
>
>gentlemen/lady, how to get the current executing file/itself absolute
>directory?
>
>thanks
-
Sharepoint Workflow : how to get document full path + file name into variable?
Hi,
Anybody knows how to get document full path + file name into a variable in Sharepoint 2010 workflow?
Example http://sp1:80/InvoiceQueue/Shared Documents/123.pdf
I am using List Workflow which links to a document library.Hi SAMSUNG,
According to your description, my understanding is that you want to get the full path of a document in a list workflow.
You can set the variable to the Enconded Absolute URL of the document. The screenshot is my testing. In my testing (in the red area), when the title of a document was equal to the tile of the current item, set a variable to the Enconded Absolute URL of the
document. I used ‘Log to history list’ to check the value of the variable in Workflow History .
I hope this helps.
Thanks,
Wendy
Wendy Li
TechNet Community Support -
Hi all,
Can any one tell how to get the number of files(.EPS) count inside a folder when the folder path is specified in VC++ 6.0?
Thanks in Advance.
Regards
myriazI'm a little confused by the question, but it sounds like you're asking how to count the number of files with a particular extension in a given directory? That's not really an AI SDK question, but it's a fairly easy one to find if you google it. If you're trying to use Illustrator to do it, AI doesn't have a general purpose file API. It has a few functions to do some things that Illustrator needs, but I don't think enumerating directories is one of them.
Maybe you are looking for
-
Can't download boot camp for Mac Air A1466
Hi, I bought a Macbook air yesterday, which I guess could be the newest version. After I got home, I'm trying to install windows on this Air. But when I try to download the Windows Support from boot camp Assistant, Its' showing the following message:
-
Charging Time for 15 inch MacBook Pro Retina
If I were to use a 60 watt charging adaptor that comes with the 13 inch MacBook Pro with Retina display instead of the 85 watt adaptor that comes with the 15 inch model to charge a 15 inch model, how much longer will it take to recharge the computer,
-
Cannot get Apple TV to work becuase it requires Home sharing turned on. It is on but it dosent work because the Service Bonjour is stopped. When I try to restart in i get error - access denied. On reading the web it seems latest version of Itunes
-
New To Oracle.. Needs Help:: Conversion from SQL Server to Oracle 11g
I am new to Oracle 11g and badly need the conversion of SQL Server Functions to Oracle.. Sample Pasted Code not working .. end with error.. pls help Create Table TempT (ID1 Varchar (10), ID2 Varchar (10) CREATE OR REPLACE PACKAGE GLOBALPKG AS TYPE RC
-
Bapi for Open Projects Cost in PS
HI, I need a bapi or funcation module for Open Projects Cost in PS . thanks.