SUBST_GET_FILE_LIST
I am using the function module SUBST_GET_FILE_LIST to get the list of files in the directory.In that there are two import parameters dirname and filenm.I wanted to know what do I enter for the above two parameters?I have with me the physical file name which I got from the logical filename using the function module FILE_GET_NAME
Can anyone please tell me what needs to be entered for the two parameters dirname and filenm and from where do I get those values from?
Hi...
Please see the test code..
REPORT z_test_subha3.
DATA: i_file TYPE STANDARD TABLE OF rsfillst INITIAL SIZE 0,
wa_file TYPE rsfillst .
Directory Block
SELECTION-SCREEN: BEGIN OF BLOCK file WITH FRAME TITLE text-002.
SELECTION-SCREEN SKIP.
PARAMETERS:
p_path TYPE rsmrgstr-path
DEFAULT './' LOWER CASE.
SELECTION-SCREEN: END OF BLOCK file.
START-OF-SELECTION.
CALL FUNCTION 'SUBST_GET_FILE_LIST'
EXPORTING
dirname = p_path
filenm = '*'
PATTERN =
TABLES
file_list = i_file
EXCEPTIONS
access_error = 1
OTHERS = 2
IF sy-subrc = 0.
LOOP AT i_file INTO wa_file.
WRITE: / wa_file-name.
ENDLOOP.
ENDIF.
Similar Messages
-
Hi
I want to get a list of all the files from a specified directory. I found these two function modules. But i am not able to run these, I am not getting how to pass the Dir name to these FM's?
please help me on this.Hello,
you can use the follow code:
REPORT zdirtest.
DATA lv_dir TYPE rsmrgstr-path VALUE '/usr/sap/trans/data'.
DATA: wa_files TYPE rsfillst,
it_files LIKE TABLE OF wa_files.
START-OF-SELECTION.
CALL FUNCTION 'SUBST_GET_FILE_LIST'
EXPORTING
dirname = lv_dir
filenm = '*'
TABLES
file_list = it_files
EXCEPTIONS
access_error = 1
OTHERS = 2.
IF sy-subrc <> 0.
WRITE /1 'Error! :-('.
ELSE.
LOOP AT it_files INTO wa_files.
WRITE: /1 wa_files-name,
wa_files-len.
ENDLOOP.
ENDIF.
However the field MTIME from the structure RSFIILST is not filled correctly with the number of seconds since 1970 because the field is defined to small.
So you can't list the correct modification date and time.
If you really need this, you should take a look in the Report RSWATCH0 in the form fill_file_list.
This form fills an internal table with the correctly modification date and time.
Regards,
Vasanth -
FM SUBST_GET_FILE_LIST no longer available in Release 702 ?
We are in the process of upgrading to ECC 6 Release 702. In the new release, the standard Function Module SUBST_GET_FILE_LIST (which is used to get a list of files on an application server directory), has all its code commented out and replaced by a single statment "raise ACCESS_ERROR".
There is an SAP "security" note 1555144 which mentioned FM SUBST_GET_FILE_LIST as a security risk and recommends that FM SUBST_GET_FILE_LIST be disabled using the "raise ACCESS_ERROR" statement. However, there seems to be no mention of an alternative FM or method that can be used to work around the security issue. There is really nothing to stop us from creating our own custom Z version of the FM, but then the security issue will still be there.
Has anyone else out there come across this issue and if so what was your approach in working around this ?
Thanks in advance.
AlvinHi all
Interesting conversation
We run into this same issue earlier this year when we did on ERP EHP5 upgrade for our client. At the moment we have a temporary solution to this, but that must replaced soon.
We asked SAP about this SUBST_GET_FILE_LIST function, and in short the answer was, well, you should not have used it because the status of that function module is Not Released. Fair enough, we really should not have used that since like they said, 'Not Released' basically means it is for internal use and they can and will change those function modules when and how they want, like they just did with this FM.
So, we asked if they have replacement for that FM. Answer was a reference to a note which tells us what is consulting and what is OSS case, meaning, either that they won't tell or they don't have a replacement.
We then searched and searched and found few nice candidates for replacement, also the ones mentioned here. But the problem with all of this function modules is the same, the status of them is 'Not Released'. Our client does not want to replace one burned function module with another 'Not Released' function module (and to be honest, neither do I), so we are in a limbo at the moment.
We do have some ideas (create our own function module which would use external command the read files etc.) but I really find it strange that there does not seem to be an official solution for this. Well, maybe when more and more clients upgrade to Netweaver 7.02, maybe then something happens.
Petri -
Use of inverter technology in portable
The Basics - Type Mayweather vs Ortiz Live Stream the letters from your rack into the Rack letters field. If you New Zealand vs Tonga Live Stream to build your word using parts of other words, then you can France vs Japan Live Stream RWC 2011 Online Free in the pattern of letters an spaces from the game Tonga vs Canada Live Stream into the Pattern field. Uscharacters for empty spaces. New Zealand vs Japan Live Stream other fields are set by default to allow this simple search to France vs Canada Live Stream properly.# Required Letters - When you want to specify that certain Tonga vs Japan Live Stream must be in any matching words returned, you can click on the Use Mayweather vs Ortiz Live Stream -Case As Required Letters? check box. Then, any letters typed New Zealand vs France Live Stream your Rack letters field that are capitalized will be required to Canada vs Japan Live Stream in the matching results. For example, if your letters contained Rugby World Cup 2011 Live Stream, and your Min. Word Lengt (born Jan. 15, 1929, Atlanta, Ga., U.Rugby World Cup 2011 Schedule Fixtures .—died April 4, 1968, Memphis, Tenn.) Baptist Scotland vs Romania Live Stream and social activist who led the civil rights movement in the United Argentina vs England Live Stream from the mid-1950s until his death by assassination in 1968. Scotland vs Georgia Live Stream leadership was fundamental to that movement's success in Argentina vs Romania Live Stream the legal segregation of African Americans in the South and England vs Georgia Live Stream parts of the United States. King rose to national prominence as England vs Romania Live Stream of the Southern Christian Leadership Conference, which promoted Argentina vs Scotland Live Stream tactics, such as the massive March on Washington (1963), to Georgia vs Romania Live Stream civil rights. He was awarded the Nobel Peace Prize in 1964.Australia vs Italy Live Stream came from a comfortable middle-class family steeped in Ireland vs USA Live Stream tradition of the Southern black ministry: both his father and maternal Russia vs USA Live Stream were Baptist preachers. His parents were college-educated, and King's Australia vs Ireland Live Stream had succeeded his father-in-law as pastor of the prestigious Italy vs Russia Live Stream Baptist Church in Atlanta. The family lived on Auburn Avenue, otherwise Australia vs USA Live Stream as “Sweet Auburn,” the bustling “black Wall Street,” home to some Ireland vs Russia Live Stream the country's largest and most prosperous black businesses Italy vs USA Live Stream black churches in the years before the civil rights movement. Young Fiji vs Namibia Live Stream received a solid education and grew up in a loving extended family. South Africa vs Wales Live Stream secure upbringing, however, did not prevent King from Samoa vs Namibia Live Stream the prejudices then common in the South. He never forgot the time South Africa vs Fiji Live Stream , at about age six, one of his white playmates announced Wales vs Samoa Live Stream his parents would no longer allow him to play with King, because the Andre Berto vs Jan Zaveck Live Stream were now attending segregated schools. Dearest to King in Berto vs Zaveck Live online early years was his maternal grandmother, whose death Vitali Klitschko vs Tomasz Adamek Live Stream 1941 left him shaken and unstable. Klitschko vs Adamek Live because he had learned of her fatal heart attack while attending a parade UFC 135 Live Stream his parents' permission, the 12-year-old King suicide by jumping from a second-UFC 135 Online Free window.In 1944, at age 15, King entered Morehouse College in Andre Berto vs Jan Zaveck Live Stream under a special wartime program intee"eto Berto vs Zaveck Live online enrollment by admitting promising high-school students like Krererererer. Klitschko vs Adamek Live Online beginning college, however, King spent the summer Vitali Klitschko vs Tomasz Adamek Live Stream tobacco farm in Connecticut; it was his first extended stay Saul Alvarez vs Alfonso Gomez Live Stream from home and his first substantial experience of race Alvarez vs Gomez Live Online outside the segregated South. He was shocked by how Yuriorkis Gamboa vs Daniel Ponce de Leon Live Stream the races mixed in the North. “Negroes Gamboa vs Daniel Ponce de Leon Live Online whites go [to] the same church,” he noted in a letter New Zealand vs Tonga Live Stream his parents. “I never [thought] that a person of my race France vs Japan Live Stream eat anywhere.” This summer experience in the North only deepened Canada vs Tonga Live Stream growing hatred of racial segregation.At Morehouse, King favoured New Zealand vs Japan Live Stream and law, but these were eclipsed in his senior year by a Rugby World Cup 2011 Live Stream to enter the ministry, as his father had urged. King's mentor at watch RWC NZ Online was the college president, Benjamin Mays, a social gospel activist whose rich Watch RWC Final 2011 Live Stream and progressive ideas had left an indelible imprint on father. Rugby World Cup Finals 2011 Live Online fighting racial inequality, Mays accused the African France vs Canada Live Stream community of complacency in the face of oppression, and he prodded Tonga vs Japan Live Stream black church into social action by criticizing its emphasis on the New Zealand vs France Live Stream instead of the here and now; it was a call to service that was Canada vs Japan Live Stream lost on the teenage King. He graduated from Morehouse in France vs Tonga Live Stream .Plantar fasciitis (say "PLAN-ter fash-ee-EYE-tus") is the most France vs Tonga Live Stream cause of heel pain. The plantar fascia camera is the flat band of New Zealand vs Canada Live Stream (ligament) that connects your heel bone to your toes. It supports Scotland vs Romania Live Stream arch of your foot. If you strain your plantar fascia, it gets England vs Argentina Live Stream , swollen, and irritated (inflamed). Then your heel or the bottom Scotland vs Georgia Live Stream your foot hurts when you stand or walk. Plantar fasciitis is Argentina vs Romania Live Stream by straining the ligament that supports your arch. Repeated strain England vs Georgia Live Stream cause tiny tears in the ligament. These can lead to pain and England vs Romania Live Stream . This is more likely to happen if:Most people with plantar Argentina vs Scotland Live Stream have pain when they take their first steps after they get out of Georgia vs Romania Live Stream or sit for a long time. You may have less stiffness and pain after England vs Scotland Live Stream take a few steps. But your foot may hurt more as the day goes Argentina vs Georgia Live Stream may hurt the most when you climb stairs or after you stand for a New Zealand vs Canada Live Stream timePlantar fasciitis is a common, painful foot condition. England vs Scotland Live Stream and sometimes doctors often confuse the terms plantar Argentina vs Georgia Live Stream and heel spurs. Plantar fasciitis refers to the syndrome of Australia vs Russia Live Stream f the band of tissue that runs from the heel along the arch of the foot; a Ireland vs Italy Live Stream spur is a hook of bone that can form on the heel bone (calcaneus).Wales vs Fiji Live Stream 70% of patients with plantar fasciitis have been noted to have a heel Ireland vs Italy Live Stream be seen on X-Ray. Plantar fasciitis is most often seen in middle-aged Ireland vs Russia Live Stream and women, but can be found in all age groups. Plantar fasciitis isU Italy vs USA Live Stream with the classic symptoms of pain well localized over the heel area Australia vs USA Live Stream the bottom of the foot. Often the pain from plantar fasciitis is most Italy vs Russia Live Stream when you first stand on your feet in the morning. Pain often subsides Australia vs Ireland Live Stream quickly, but then returns after prolonged standing or walking. USA vs Russia Live Stream fasciitis is sometimes, but not always, associated with a rapid gain of Ireland vs USA Live Stream . Plantar fasciitis is also sometimes seen in recreational athletes, Australia vs Italy Live Stream runners. In these athletes, it is thought that the repetitive nature of Australia vs Russia Live Stream sports causes the damage to the fibrous tissue that forms the Fiji vs Namibia Live Stream of the foot. Plantar fasciitis can be confused with a condition South Africa vs Wales Live Stream tarsal tunnel syndrome. In tarsal tunnel syndrome, an Samoa vs Namibia Live Stream nerve in the foot, the tibial nerve, is trapped and pinched as it passes Wales vs Samoa Live Stream the tarsal tunnel, a condition analogous to carpal tunnel syndrome in South Africa vs Namibia Live Stream wrist. This may cause symptoms similar to the pain of a Fiji vs Samoa Live Stream fasciitis. There are also other less common problems such as nerve Wales vs Namibia Live Stream , stress fractures, and fat pad necrosis, all of which can cause foot South Africa vs Samoa Live Stream . Finally, several rheumatologic conditions can cause Wales vs Fiji Live Stream pain. These syndromes such as Reiter's syndrome and ankylosing Vic Darchinyan vs Evans Mbamba Live Stream can cause heel pain similar to plantar fasciitis. If your Darchinyan vs Mbamba Live are not typical for plantar fasciitis, or if your symptoms do not resolve Andorra vs Armenia Live Stream treatment, your doctor will consider these possible diagnoses.Azerbaijan vs Belgium Live Stream fasciitis occurs because of irritation to the thick ligamentous Belarus vs Bosnia Herzegovina Live Stream tissue that runs from the heel bone to the ball of England vs Bulgaria Live Stream foot. This strong and tight tissuMost generators are labeled Finland vs Moldova Live Stream a decibel rating. For every increase in 10 decibels, the noise level France vs Albania Live Stream 10 times more powerful. A generator that runs at 70 decibels is Georgia vs Latvia Live Stream times as loud as a generator that runs at 60 decibels.Honda's Germany vs Austria Live Stream technology allows you to get cleaner power with less weight. The Hungary vs Sweden Live Stream offers the benefits of AVR-type generator at a lower size and Ireland vs Slovakia Live Stream .Inverters produce the cleanest power of all. These units are ideal for Israel vs Greece Live Stream electronics, such as computers. Inverter generators offer a number Italy vs Faroe Islands Live Stream benefits, including less noise, lower weight, and greater fuel Lithuania vs Liechtenstein Live Stream as compared to traditional models.Honda Luxembourg vs Romania Live Stream the use of inverter technology in portable generators with our Malta vs Croatia Live Stream EU series. Honda generators have a well earned reputation for Netherlands vs San Marino Live Stream and durability. Honda products are tested extensively and Northern Ireland vs Serbia Live Stream using the best quality materials. Our generators offer Norway vs Iceland Live Stream power and keep on running year after year.Because a generator Portugal vs Cyprus Live Stream a major investment, look for a manufacturer that stands Russia vs Macedonia Live Stream their product fully. In particular, service and parts Scotland vs Czech Republic Live Stream are essential for your peace of mind. Honda generators are Slovenia vs Estonia Live Stream by a comprehensive warranty and the best dealer network in the Turkey vs Kazakhstan Live Stream . With over 2000 authorized Honda dealers nationwide, Wales vs Montenegro Live Stream a local dealer is easy. And getting the best in class service is never Soto vs Alfaro Live Stream doubt.Generators are produced in different sizes and with diverse TNA No Surrender 2011 Live Stream to respond to particular market and user needs. There are Klitschko vs Adamek Live Stream , portable generators, and also those that can be pushed or pulled Vitali Klitschko vs Tomasz Adamek Live Stream on their own wheels or by using a small trailer. Soto vs Alfaro Live Stream are also huge generators which need to be housed in custom-built Mayweather vs Ortiz Live Stream Smaller generators are capable of producing a few Watch Mayweather vs Ortiz Online watts of power, while larger units can produces thousands TNA No Surrender 2011 Live Stream or even tens of thousands. Special generator models are popular for RV or boat needs. The Honda generator is the most popular item of its kind throughout the world. A wide selection of Honda generators is available
Hi,
Statndard Transaction in SAP itself uses the same C-Calls.
For Eg , AL11 uses these C-Calls.
The Function module SUBST_GET_FILE_LIST fetch all the files in a specified folder.But still this too iuses C-Calls
Regards
Immanuel D -
Regarding Application server file path browsing
Hi All,
I have a issue regarding Application Server File Path browsing.
Actually in my selection-screen i will declare a parameter as <b>Application Server File Path</b> now when i press F4 in that field it should be able to browse through <b>Application Server Path's</b>.
Just like <b>F4_FILENAME</b> in the case of <b>Presentation Server File Path</b> Browsing.
Can anybody solve my issue.
Thanks in advance.
Thanks & Regards,
Rayeez.Hi Shaik,
Just copy and paste:
Here is the code for retrieving list of files contained within specific Application server directory(SAP).
PARAMETER: p_fdir type pfeflnamel DEFAULT '/usr/sap/tmp'.
data: begin of it_filedir occurs 10.
include structure salfldir.
data: end of it_filedir.
START-OF-SELECTION.
Get Current Directory Listing for OUT Dir
call function 'RZL_READ_DIR_LOCAL'
exporting
name = p_fdir
tables
file_tbl = it_filedir.
List of files are contained within table it_filedir
loop at it_filedir.
write: / it_filedir-NAME.
endloop.
Hope this will help you.
Let me know incase of any concerns.
EDIT:
There are few FM for ur refernce :
RZL_READ_DIR_LOCAL
SUBST_GET_FILE_LIST Return table with file list for the given directory (pattern allowed)
F4_DXFILENAME_TOPRECURSION Popup to select one file from the given application server directory
TH_SERVER_LIST Returns list of application servers.
EPS_GET_DIRECTORY_LISTING Lists filenames from the application server .
Cheers
Sunny
Rewrd points, if found helpful
Message was edited by: Sunny -
Hi,
here i am picking the file from APPS and also inbound IDOC creation.
just anyone check my code and give some suggestions in the areas of impovemet technically.
thanks
report znsd007.
*tables : zih001, zid001.
tables: zstbm_lots, zstbm_stages, zibmordertype.
data: t_zstbmlot like zstbm_lots occurs 0 with header line,
t_zstbmstage like zstbm_stages occurs 0 with header line.
parameters :
fromdir like rsmrgstr-path lower case default
'/apps/MQBridge/idocmsgs/',
fromfile like rsmrgstr-name lower case default '*.txt',
todir like rsmrgstr-path lower case default
'/apps/MQBridge/idoctemp/',
tofile like edi_path-pthnam lower case no-display,
procdir like rsmrgstr-path lower case default
'/apps/MQBridge/idocproc/',
procfile like edi_path-pthnam lower case no-display,
toport like edipo-port no-display.
constants: c_tst(7) value 'IBM_TST',
c_bi(6) value 'IBM_BI',
c_mrk(7) value 'IBM_MRK',
c_sbt(7) value 'IBM_SBT'.
data: w_tst(1) type c,
w_bi(1) type c,
w_mrk(1) type c,
w_sbt(1) type c,
w_err(1) type c,
w_processcd(20) type c.
data :
file_list like rsfillst occurs 100 with header line,
pattern like rsmrgstr-name,
tmpfile(128),
begin of in1 occurs 100,
dir(128),
file(128),
data(63000) occurs 0,
data(1063) occurs 0,
end of in1,
str(63000),
*str(1063),
str2 like str,
*outfile(63000) occurs 100 with header line,
*outfile(128),
crtl like edi_dc40,
*counter type i,
segment like edi_dd40-segnam,
segment_no(6) type n,
data like edi_dd40-sdata,
productid_ecid(25),
edidd40 like edi_dd40.
field-symbols : <fs2>,<fs>.
data: messtab like bdcmsgcoll occurs 0 with header line.
start-of-selection.
break-point.
perform getfile_list tables file_list using fromdir fromfile.
delete file_list where type = 'directory'.
toport = 'FILE'.
loop at file_list.
perform getfile tables in1 using file_list.
endloop.
sort in1 by dir file.
check not in1[] is initial.
loop at in1.
at new file.
concatenate todir '/' in1-file into tofile.
replace '//' with '/' into tofile.
condense tofile no-gaps.
open dataset tofile for output in text mode encoding default.
if sy-subrc ne 0.
message e168(j4) with tofile.
endif.
Copy the populated dataset to be saved into a processed directory
concatenate procdir '/' in1-file into procfile.
replace '//' with '/' into procfile.
condense procfile no-gaps.
open dataset procfile for output in text mode encoding default.
if sy-subrc ne 0.
message e168(j4) with procfile.
endif.
clear : edidd40, crtl.
crtl-tabnam = 'EDI_DC40'.
crtl-mandt = sy-mandt.
crtl-docrel = '620'.
crtl-direct = '02'.
concatenate 'SAP' sy-sysid into crtl-rcvpor.
crtl-rcvprt = 'LS'.
crtl-rcvprn = 'SSD_PN0001'.
crtl-mestyp = 'ZCPAOC'.
crtl-idoctyp = 'ZCPAOC01'.
crtl-sndpor = 'SSD0000001'.
crtl-sndprt = 'LS'.
crtl-sndprn = 'SSD_PN0001'.
transfer crtl to : procfile.
clear segment_no.
endat.
refresh t_zstbmlot.
refresh t_zstbmstage.
loop at in1-data into str.
clear edidd40.
edidd40-mandt = sy-mandt.
check not str is initial.
search str for ','.
if sy-subrc = 0.
segment = str+0(sy-fdpos).
sy-fdpos = sy-fdpos + 1.
data = str+sy-fdpos.
case segment.
when 'ZSTBM_LOT'.
clear t_zstbmlot.
split data at ',' into t_zstbmlot-aufnr
t_zstbmlot-ordertype
t_zstbmlot-plant
t_zstbmlot-productid
t_zstbmlot-ec
t_zstbmlot-lotlabel
t_zstbmlot-other_lot_label1
t_zstbmlot-orderqty
t_zstbmlot-customercd
t_zstbmlot-srcevendor
t_zstbmlot-waferid
t_zstbmlot-lotowner
t_zstbmlot-lottype
t_zstbmlot-prty
t_zstbmlot-planstart
t_zstbmlot-planfinish
t_zstbmlot-linecodejc
t_zstbmlot-qualitycod
t_zstbmlot-poi
t_zstbmlot-poi_text
t_zstbmlot-cot
t_zstbmlot-cot_text
t_zstbmlot-lotprodtyp
t_zstbmlot-productcd
t_zstbmlot-familycd
t_zstbmlot-lot_cmmnt
t_zstbmlot-devassem
t_zstbmlot-devassemtx
t_zstbmlot-numdevices
t_zstbmlot-date_of_mfg
t_zstbmlot-pur_order
t_zstbmlot-process_cd.
append t_zstbmlot.
edidd40-segnam = 'ZSTBM_LOT'.
edidd40-hlevel = '2'.
segment_no = segment_no + 1.
edidd40-segnum = segment_no.
edidd40-sdata = t_zstbmlot.
when 'ZSTBM_STAGE'.
clear t_zstbmstage.
split data at ',' into t_zstbmstage-stage.
move data to t_zstbmstage-stage.
append t_zstbmstage.
edidd40-segnam = 'ZSTBM_STAGE'.
edidd40-hlevel = '3'.
edidd40-psgnum = segment_no.
edidd40-sdata = t_zstbmstage.
endcase.
transfer edidd40 to : procfile.
endif.
endloop.
t_zstbmlot-date_of_mfg = t_zstbmlot-date_of_mfg(8).
Determine the order type here using t_zstbmstage and t_zstbmlot
and update order type int t_zstbmlot.
clear w_tst. clear w_bi. clear w_mrk. clear w_sbt. clear w_err.
clear w_processcd.
loop at t_zstbmstage.
if t_zstbmstage-stage = c_tst.
w_tst = 'X'.
elseif t_zstbmstage-stage = c_bi.
w_bi = 'X'.
elseif t_zstbmstage-stage = c_mrk.
w_mrk = 'X'.
elseif t_zstbmstage-stage = c_sbt.
w_sbt = 'X'.
endif.
endloop.
if t_zstbmlot-process_cd = 'SubStock Release' or
t_zstbmlot-process_cd = 'SUBSTOCK RELEASE'.
w_processcd = 'SUBSTOCK RELEASE'.
endif.
select single * from zibmordertype
into zibmordertype where
ibm_tst = w_tst and
ibm_bi = w_bi and
ibm_mrk = w_mrk and
ibm_sbt = w_sbt and
processcd = w_processcd.
if sy-subrc = 0.
t_zstbmlot-ordertype = zibmordertype-ordertype.
else.
write: 'Order type not determined for lot label:',
t_zstbmlot-lotlabel.
endif.
Put into zih001 to create idoc
clear : edidd40, crtl.
crtl-tabnam = 'EDI_DC40'.
crtl-mandt = sy-mandt.
crtl-docrel = '620'.
crtl-direct = '02'.
concatenate 'SAP' sy-sysid into crtl-rcvpor.
crtl-rcvprt = 'LS'.
crtl-rcvprn = 'SSD_PN0001'.
crtl-mestyp = 'ZCPAOC'.
crtl-idoctyp = 'ZCPAOC01'.
crtl-sndpor = 'SSD0000001'.
crtl-sndprt = 'LS'.
crtl-sndprn = 'SSD_PN0001'.
transfer crtl to : tofile.
clear : edidd40.
edidd40-segnam = 'ZIH001'.
edidd40-mandt = sy-mandt.
edidd40-hlevel = 1.
edidd40-sdata = t_zstbmlot.
transfer edidd40 to : tofile.
check not in1-data[] is initial.
at end of file.
close dataset : procfile, tofile.
call function 'EDI_DATA_INCOMING'
EXPORTING
pathname = tofile
port = toport.
check sy-subrc = 0.
Remove file from idocmsgs directory after idoc processing
clear tmpfile.
concatenate in1-dir '/' in1-file into tmpfile.
replace '//' with '/' into tmpfile.
condense tmpfile no-gaps.
delete dataset tmpfile.
endat.
endloop.
form getfile_list tables intab1 structure rsfillst using inval1 inval2 .
call function 'SUBST_GET_FILE_LIST'
exporting
dirname = inval1
filenm = ''
pattern = inval2
tables
file_list = intab1
EXCEPTIONS
ACCESS_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. "getfile_list
*& Form getfile
text
-->P_FIELD_LIST text
form getfile tables intab1 structure in1
using inval structure file_list.
data : xfile(128).
clear xfile.
concatenate inval-dirname '/' inval-name into xfile.
replace '//' with '/' into xfile.
open dataset xfile for input message messtab
in text mode encoding default.
check sy-subrc = 0.
clear : str, intab1. refresh intab1-data.
do.
replace ALL OCCURRENCES OF
cl_abap_char_utilities=>horizontal_tab
in xfile with space.
replace all occurrences of '#' in xfile with space.
replace all occurrences of ':' in xfile with space.
replace all occurrences of '_' in xfile with space.
read dataset xfile into str.
replace all occurrences of '#' in str with space.
replace all occurrences of ':' in str with space.
replace all occurrences of '_' in str with space.
if sy-subrc <> 0.
exit.
endif.
intab1-file = inval-name.
intab1-dir = inval-dirname.
append str to intab1-data.
enddo.
if not intab1-data[] is initial.
append intab1.
endif.
close dataset xfile.
endform. " getfile
form showdata changing inval indat.
data : xxtab like sval occurs 100 with header line,
ff0(100), ff1(30), ff2(30), yesno.
inval = indat.
do.
assign component sy-index of structure inval to <fs>.
Z1STB_HDR TO <FS>.
if sy-subrc <> 0. exit. endif.
describe field <fs> help-id ff0.
split ff0 at '-' into ff1 ff2.
clear xxtab.
xxtab-tabname = ff1. xxtab-fieldname = ff2. xxtab-value = <fs>.
append xxtab.
enddo.
call function 'POPUP_GET_VALUES_USER_HELP'
EXPORTING
popup_title = 'Enter Order Information'
TABLES
fields = xxtab
EXCEPTIONS
error_in_fields = 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. "showdatahi
i can see views are increasing inmy post. bu ti am not unable to see any when i enter. where are the views stored for this thread. now i am just clicking the reply to this thread.
please let me know where can i see th eviews.
thanks -
Hi Experts,
See the following code.
When i run this program in fore ground it is giving time out error.Current running time is 600 Sec.When i run in Back ground with Immediate.Excute option after some time the job is cancled.When i see the job log It is mentioned as "More memory space requested".
Can any body Plz go thru the code and tell me what is the problem?
*& Report ZTEST_XML
REPORT ZTEST_XML.
*data: ifile like salfldir occurs 0 with header line.
data:p_path TYPE rsmrgstr-path value 'F:\usr\sap\CD5\serena\OCOS\'.
data: p_file type string.
TYPES: BEGIN OF t_xml_line, "Structure for holding XML data
data(256) TYPE x,
END OF t_xml_line.
data: BEGIN OF t_xml occurs 0,
rec TYPE x,
END OF t_xml.
data: begin of jtab occurs 0,
text type string,
end of jtab.
DATA: l_xml_table TYPE TABLE OF t_xml_line. " XML Table of the structure
data: wa(256) type x.
data: wa_xml like l_xml_table occurs 0.
data: l_str type string.
data: start_line type i,
end_line type i,
v_str type string.
data: cnt type i,
idx type i,
count1 type i,
len type i,
diff type i.
data: catalogid type string.
DATA : BEGIN OF DAT OCCURS 0,
LIN type string,
END OF DAT.
DATA: BASIC_TEXT LIKE THEAD OCCURS 0 WITH HEADER LINE.
DATA: YGUID LIKE COMM_PCAT_CTY-GUID,
ZGUID LIKE COMM_PCAT_CTV-PARENT_CATEGORY.
DATA: BASICTEXT like TLINE OCCURS 0 WITH HEADER LINE.
DATA: IT_THEAD LIKE THEAD OCCURS 0 WITH HEADER LINE.
data: begin of IT_SERENA occurs 0,
ID LIKE COMM_PCAT_CTY-ID,
TEXT type string,
end of IT_SERENA.
DATA:WA_SERENA like IT_SERENA.
DATA: wa_files TYPE rsfillst,
ifile LIKE TABLE OF wa_files.
data: begin of it_error occurs 0,
err type string,
end of it_error.
data: errorfile type string value 'error.txt'.
CALL FUNCTION 'SUBST_GET_FILE_LIST'
EXPORTING
DIRNAME = p_path
FILENM = '*'
PATTERN =
TABLES
FILE_LIST = ifile
EXCEPTIONS
ACCESS_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.
loop at ifile into wa_files.
if not wa_files-name cs '.xml'.
delete ifile.
endif.
endloop.
loop at ifile into wa_files.
concatenate p_path wa_files-name into p_file.
open dataset p_file for input in text mode encoding default.
if sy-subrc = 0.
do.
read dataset p_file into l_str.
if l_str = space.
exit.
endif.
if sy-subrc <> 0.
concatenate text-002 p_file into it_error-err.
append it_error.
clear it_error.
exit.
else.
jtab-text = l_str.
append jtab.
clear jtab.
endif.
enddo.
else.
concatenate text-001 p_file into it_error-err.
append it_error.
clear it_error.
continue.
endif.
loop at jtab.
if jtab-text cs 'Catalog ID'.
idx = sy-tabix .
endif.
endloop.
read table jtab index idx.
if sy-subrc = 0.
catalogid = jtab-text.
endif.
if catalogid cs '<![CDATA['.
shift catalogid left by 56 places.
endif.
if catalogid cs ']]></field>'.
replace ']]></field>' with space into catalogid.
endif.
write:/ 'Catalogid is:', catalogid.
IT_SERENA-ID = catalogid.
LOOP AT jTAB.
if jtab-text cs 'longDescription'.
start_line = sy-tabix + 1.
exit.
endif.
endloop.
cnt = start_line.
do.
read table jtab index cnt.
if jtab-text cs '</field>'.
end_line = sy-tabix.
exit.
else.
cnt = cnt + 1.
endif.
enddo.
loop at jtab from start_line to end_line.
concatenate jtab-text v_str into v_str separated by space.
endloop.
shift v_str left by 18 places.
shift v_str left by 10 places.
len = strlen( v_str ).
DO.
IF COUNT1 >= LEN.
EXIT.
ENDIF.
DIFF = LEN - COUNT1.
IF DIFF < 125.
DAT-LIN = v_str+COUNT1(DIFF).
ELSE.
DAT-LIN = v_str+COUNT1(125).
ENDIF.
DAT-LIN = v_str+COUNT1(125).
APPEND DAT.
WRITE :/ DAT-LIN.
CLEAR DAT.
COUNT1 = COUNT1 + 125.
ENDDO.
REFRESH BASIC_TEXT.
REFRESH BASICTEXT.
CLEAR YGUID.
CLEAR ZGUID.
SELECT SINGLE GUID FROM COMM_PCAT_CTY INTO YGUID
WHERE ID = IT_SERENA-ID.
IF NOT YGUID IS initial.
if sy-subrc <> 0.
concatenate text-003 p_file into it_error-err.
append it_error.
clear it_error.
else.
SELECT SINGLE GUID FROM COMM_PCAT_CTV INTO ZGUID
WHERE PARENT_CATEGORY = YGUID.
ENDIF.
BASIC_TEXT-TDOBJECT = 'PCAT_CTY'.
BASIC_TEXT-TDNAME = ZGUID.
BASIC_TEXT-TDID = '0001'.
BASIC_TEXT-TDSPRAS = 'EN'.
APPEND BASIC_TEXT.
loop at DAT.
BASICTEXT-TDFORMAT = '*'.
BASICTEXT-TDLINE = DAT-LIN.
APPEND BASICTEXT.
endloop.
refresh DAT.
loop at basictext.
if basictext-tdline cs '![CDATA['.
replace '![CDATA[' with space into basictext-tdline.
ENDIF.
modify basictext.
ENDLOOP.
loop at basictext.
if basictext-tdline cs ']]>'.
replace ']]>' with space into basictext-tdline.
modify basictext.
endif.
endloop.
CALL FUNCTION 'SAVE_TEXT'
EXPORTING
CLIENT = SY-MANDT
HEADER = BASIC_TEXT
INSERT = 'X'
SAVEMODE_DIRECT = 'X'
OWNER_SPECIFIED = ' '
LOCAL_CAT = ' '
IMPORTING
FUNCTION =
NEWHEADER = IT_THEAD
TABLES
LINES = BASICTEXT
EXCEPTIONS
ID = 1
LANGUAGE = 2
NAME = 3
OBJECT = 4
OTHERS = 5
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CLEAR IT_THEAD.
IF SY-SUBRC = 0.
WRITE:/ 'DATA UPLOADED SUCCESSFULLY'.
ELSE.
WRITE:/ 'DATA NOT UPLOADED'.
ENDIF.
refresh jtab.
refresh DAT.
COUNT1 = 0.
clear v_str.
REFRESH BASICTEXT.
refresh dat.
close dataset p_file.
endloop.
open dataset errorfile for appending in text mode encoding default.
if sy-subrc = 0.
loop at it_error.
transfer it_error-err to errorfile.
endloop.
close dataset errorfile.
endif.
Is there any other FM which is similar to SAVE_TEXT?That depends. Can you please provide some more info how the programs are linked:
several steps in batch planning
cascade of submits
and what kind of failure might occur:
shortdump
Kind Regards
Klaus -
Shortdump while calling UNIX command
Hi all,
I have a problem while trying to remove a file in UNIX platform in ABAP program.
It is working fine in the development and quality server, but not in production server.
Based on the debug result, the shortdump was thrown while executing "CALL 'SYSTEM' ID 'COMMAND' FIELD lv_command".
Below are the message return in the program shortdump
How to correct the error
You can check the authorization beforehand with the
function module AUTHORITY_CHECK_C_FUNCTION.
Short text
No authorization to call the C function "SYSTEM".
DATA: lv_command(100) TYPE C,
client_path LIKE RCGFILETR-FTAPPL,
server_path LIKE RCGFILETR-FTAPPL.
DATA: wa_files TYPE rsfillst,
it_files LIKE TABLE OF wa_files.
CALL FUNCTION 'SUBST_GET_FILE_LIST'
EXPORTING
dirname = gv_unix
filenm = '*'
TABLES
file_list = it_files
EXCEPTIONS
access_error = 1
OTHERS = 2.
IF sy-subrc = 0.
LOOP AT it_files INTO wa_files WHERE TYPE <> 'directory'.
CONCATENATE wa_files-dirname wa_files-name INTO server_path.
CONCATENATE p_fname wa_files-name INTO client_path.
CALL FUNCTION 'C13Z_FILE_DOWNLOAD_ASCII'
EXPORTING
i_file_front_end = client_path
i_file_appl = server_path
I_FILE_OVERWRITE = 'X'
EXCEPTIONS
FE_FILE_OPEN_ERROR = 1
FE_FILE_EXISTS = 2
FE_FILE_WRITE_ERROR = 3
AP_NO_AUTHORITY = 4
AP_FILE_OPEN_ERROR = 5
AP_FILE_EMPTY = 6
OTHERS = 7.
IF sy-subrc = 0.
concatenate 'rm -f' server_path into lv_command separated by space.
condense lv_command.
CALL 'SYSTEM' ID 'COMMAND' FIELD lv_command.
CLEAR: lv_command.
ENDIF.
ENDLOOP.
ENDIF.
Anyone knows why and how to resolve this?
Kindly provide your feedback and input. Thanks in advance.You don't have authorisation in PRD to remove files. If it is really required for you.
Take SU53 screen shot immediately once you get short dump and follow up with Basis Folks for required authorisation.
Thanks,
Raj -
File extraction -File name is timestamped
Hi Team,
We are loading the data using flat file. The file will be stored in the application directory. we created a logical fiel name and it is used in the data source.
My problem is every day the file is uploaded to the applicaiton directory and the file name will be appended with time stamp
for example
file_01022011123445
file_02022011042015
I tried to handle this by creating an abap routine ,but i am unable to get the exact file name since the timestamp field is dyanamic.I even tried to read the file names from the applicaiton directory using following function modules
SUBST_GET_FILE_LIST
F4_DXFILENAME
FILE_GET_NAME
But it didnot worked. Any suggestion will be appreciated.
Thanks,
Jim
Edited by: Jim Jose on Feb 2, 2011 1:04 PMHi,
Your file naming convention seems to be "file_ddmmyyyyhhmmss". That means you already know the first 13 characters of the filename you need. ("file_" is constant, the next 8 characters come from sy-datum)
The FM SUBST_GET_FILE_LIST accepts wildcards, so you could give the FILENM parameter as *. It would give you the names of all the files in the directory. After that, it is a matter of ignoring all the files which do NOT begin with those 13 characters. If you have one file being created in the directory for every day, this should work
Regards,
Suhas -
Problem with RZL_READ_DIR_LOCAL
Hi Experts,
The Function module RZL_READ_DIR_LOCAL is reading the APPLICATION server AL11 directory path and list all the folders & file inside that directory into an internal table FILE_TBL.
Since the size of the field FILE_TBL-NAME is 32 chars . So if a file name is about 100 chars long , I'm getting only the 32 chars as file name. Rest are getting truncated.
I searched in SDN and got this FM SUBST_GET_FILE_LIST but here the size is 75 chars.
Is there any way to solve this? any FM to return the whole 255 char length of file name??
Please suggest.
Rgds,
LakshmirajYes... it involves XML files with long names.....
The kernel call is
Send Request, wait for Response
CALL 'ALERTS' ID 'ADMODE' FIELD AD_RZL
ID 'OPCODE' FIELD RZL_OP_RD_DIR
ID 'FILE_NAME' FIELD FULL_NAME
ID 'DIR_TBL' FIELD LINE_TBL-SYS.
CASE SY-SUBRC.
WHEN 0. LOOP AT LINE_TBL.
FILE_TBL-SIZE = LINE_TBL(11).
FILE_TBL-NAME = LINE_TBL+12.
APPEND FILE_TBL.
ENDLOOP.
WHEN OTHERS. RAISE NOT_FOUND.
ENDCASE.
So , creating z-function module with modiifed structure parameter might be the possible solution or any more?? -
Get File Names & Creation Time of the files of a directory in App. Server
Dear all,
My requirement is to fetch all the file names of a paritucular direcory in the application server. After going through SDN i got some FM's like
1. EPS_GET_DIRECTORY_LISTING
2. EPS_GET_FILE_ATTRIBUTES
3. SUBST_GET_FILE_LIST
Here EPS_GET_DIRECTORY_LISTING looks perfect for my requirement. But while I tried to test the FM from SE37 its giving exception READ_DIRECTORY_FAILED for the required Directory. But the same FM is returning file names for the root directory.
Please look a above 2 scenario...
ie. if I give Export parameter as
DIR_NAME = '/'
FILE_MASK = '*'
The FM works fine.
But . if I give Export parameter as
DIR_NAME = '/XYZ'
FILE_MASK = '*'
The FM returns exception READ_DIRECTORY_FAILED .
But the directory /XYZ exists and there are files in it..Am I missing something with respect to the path am specifying.
Regards,
AntonyHi, see if this peace of code helps you.
CONSTANTS DAYS1980 TYPE I VALUE 3652.
DATA: DLIST LIKE EPSFILI OCCURS 0 WITH HEADER LINE, DPATH LIKE EPSF-EPSDIRNAM, MDATE LIKE SY-DATUM, MTIME LIKE SY-UZEIT, POINT_IN_TIME TYPE I.
DATA: BEGIN OF FATTR OCCURS 0, FILE_NAME LIKE EPSF-EPSFILNAM, FILE_SIZE LIKE EPSF-EPSFILSIZ, FILE_OWNER LIKE EPSF-EPSFILOWN, FILE_MODE LIKE EPSF-EPSFILMOD, FILE_TYPE LIKE EPSF-EPSFILTYP, FILE_MTIME(12), END OF FATTR.
PARAMETER P_PATH(50) TYPE C DEFAULT '/TMP' LOWER CASE.
DPATH = P_PATH.
CALL FUNCTION 'EPS_GET_DIRECTORY_LISTING'
EXPORTING
DIR_NAME = DPATH
TABLES
DIR_LIST = DLIST
EXCEPTIONS
INVALID_EPS_SUBDIR = 1
SAPGPARAM_FAILED = 2
BUILD_DIRECTORY_FAILED = 3
NO_AUTHORIZATION = 4
READ_DIRECTORY_FAILED = 5
TOO_MANY_READ_ERRORS = 6
EMPTY_DIRECTORY_LIST = 7
OTHERS = 8.
IF SY-SUBRC EQ 0.
LOOP AT DLIST.
CALL FUNCTION 'EPS_GET_FILE_ATTRIBUTES'
EXPORTING
FILE_NAME = DLIST-NAME
DIR_NAME = DPATH IMPORTING
FILE_SIZE = FATTR-FILE_SIZE
FILE_OWNER = FATTR-FILE_OWNER
FILE_MODE = FATTR-FILE_MODE
FILE_TYPE = FATTR-FILE_TYPE
FILE_MTIME = FATTR-FILE_MTIME.
FATTR-FILE_NAME = DLIST-NAME.
APPEND FATTR.
ENDLOOP.
ENDIF.
SORT FATTR BY FILE_NAME.
LOOP AT FATTR.
POINT_IN_TIME = FATTR-FILE_MTIME.
CALL FUNCTION 'POINT_IN_TIME_CONVERT'
EXPORTING
POINT_IN_TIME = POINT_IN_TIME
IMPORTING
DATE = MDATE
TIME = MTIME
EXCEPTIONS OTHERS = 1.
SUBTRACT DAYS1980 FROM MDATE.
WRITE: / FATTR-FILE_NAME, FATTR-FILE_SIZE, MDATE, MTIME.
ENDLOOP. -
Directory listing : Codepage problem ???
Hi there,
i want to fetch a list of files from a specific directory (the directory would be in the application server and not in the presentation server) during a background execution of a report.
I have tried the function modules 'SUBST_GET_FILE_LIST' and 'EPS_GET_DIRECTORY_LISTING'.
The problem is that the list of files comes with unknown characters when there is a file name with Greek characters.
Is this an application server setup problem or there is a possibility to get a correct file list through another function module?
Thanks in advance.
KostasThere was a misconfiguration on the server side. Consider this question as answered.
Kostas -
Hi Gurus,
I have requirement to read the flie names from application server and upload to Ztable then accoring to time stamp it has to excute the infopackage ( for this routine in infopackge external data tab).
I find some Function module "SUBST_GET_FILE_LIST" from this I am getting all the data except the date and time these are the important fileds for my requirement. Can any one put some light on this.
It will be great helpful for me.
Thanks In advance
Regards
SiddhuHi Siddhu,
See if the following gives you any joy!
Re: File List from Workstation
Good luck, BB -
Dynamically Reading Files From Application Server
Hi Experts,
Presently I have to write a program which reads files from the application server dynamically. This program will be scheduled in the background with the frequency of half an hour.
I am Using the function module
CALL FUNCTION 'SUBST_GET_FILE_LIST'
EXPORTING
DIRNAME = '/usr/sap/xxx/xxx/'
FILENM = 'DATASET'
PATTERN = '.txt'
TABLES
FILE_LIST = IT_FILELIST
I am facing problem in specifying the parameter FILENM in the function module,
As I have to read many files from the apps server. How to assign the parameter of function module so it can take the many files generated in the apps server.
Thanks in Advance,
Regards,
Irfan HussainHi,
Instead of the above FM, you can use the following code :
AT SELECTION-SCREEN ON VALUE-REQUEST FOR po_ifile.
PERFORM get_current_directory USING 'PO_IFILE' po_ifile
rov-home_dir rov-curr_dir.
PERFORM get_filename-of-server TABLES itab_filename
USING rov-curr_dir rov-gen_name.
PERFORM help_values_get_with_table_ext TABLES itab_filename
USING rov-curr_dir
po_ifile.
*& Form get_current_directory
text
-->P_0023 text
-->P_PO_IFILE text
-->P_ROV_HOME_DIR text
-->P_ROV_CURR_DI text
-->P_CALL text
-->P_FUNCTION text
-->P_0029 text
-->P_IMPORTING text
-->P_FILE_NAME text
-->P_= text
-->P_PO_IFILE text
FORM get_current_directory USING _fieldname
_filename
homedir
currdir.
IF _fieldname <> space.
PERFORM dunp_value_read USING _fieldname _filename.
ENDIF.
IF _filename = space.
currdir = homedir.
ELSE.
rov-work_dir = _filename.
rov-fdpos = STRLEN( rov-work_dir ).
DO.
IF rov-fdpos = 0.
EXIT.
ENDIF.
rov-fdpos = rov-fdpos - 1.
ASSIGN rov-work_dir+rov-fdpos(1) TO <rov_p>.
IF <rov_p> = rov-delchar.
<rov_p> = space.
EXIT.
ELSE.
<rov_p> = space.
ENDIF.
ENDDO.
currdir = rov-work_dir.
ENDIF.
ENDFORM. " get_current_directory
*& Form get_filename-of-server
text
-->P_ITAB_FILENAME text
-->P_ROV_CURR_DIR text
-->P_ROV_GEN_NAME text
FORM get_filename-of-server TABLES nametab STRUCTURE itabfilename
USING _dirname _genname.
CALL 'C_DIR_READ_FINISH' " just to be sure
ID 'ERRNO' FIELD rov-errno
ID 'ERRMSG' FIELD rov-errmsg.
CALL 'C_DIR_READ_START' ID 'DIR' FIELD _dirname
ID 'FILE' FIELD _genname
ID 'ERRNO' FIELD rov-errno
ID 'ERRMSG' FIELD rov-errmsg.
IF sy-subrc <> 0.
EXIT.
ENDIF.
REFRESH _nametab.
DO.
CLEAR _nametab.
CALL 'C_DIR_READ_NEXT' ID 'TYPE' FIELD _nametab-type
ID 'NAME' FIELD _nametab-name
ID 'LEN' FIELD _nametab-len
ID 'OWNER' FIELD _nametab-owner
ID 'MTIME' FIELD _nametab-mtime
ID 'MODE' FIELD _nametab-mode
ID 'ERRNO' FIELD _nametab-errno
ID 'ERRMSG' FIELD _nametab-errmsg.
_nametab-dirname = _dirname.
MOVE sy-subrc TO _nametab-subrc.
CASE sy-subrc.
WHEN 0.
IF _nametab-name+0(1) = '.'.
ELSE.
APPEND _nametab.
ENDIF.
WHEN 1.
EXIT.
WHEN OTHERS. " SY-SUBRC >= 2
EXIT.
ENDCASE.
ENDDO.
CALL 'C_DIR_READ_FINISH' " just to be sure
ID 'ERRNO' FIELD rov-errno
ID 'ERRMSG' FIELD rov-errmsg.
ENDFORM. " get_filename-of-server
*& Form help_values_get_with_table_ext
text
-->P_ITAB_FILENAME text
-->P_ROV_CURR_DIR text
-->P_PO_IFILE text
FORM help_values_get_with_table_ext TABLES _filename
STRUCTURE itab_filename
USING _currdir
_selfile.
TYPES: BEGIN OF f4typ_head_struc,
tabname LIKE help_info-tabname,
fieldname LIKE help_info-fieldname,
head_text LIKE shstruc-keyword,
END OF f4typ_head_struc.
DATA itab_fields LIKE TABLE OF help_value WITH HEADER LINE.
DATA itab_selvals LIKE TABLE OF help_vtab WITH HEADER LINE.
DATA itab_values LIKE TABLE OF rlgrap-filename WITH HEADER LINE.
DATA itab_header TYPE TABLE OF f4typ_head_struc WITH HEADER LINE.
REFRESH itab_fields.
REFRESH itab_selvals.
REFRESH itab_values.
REFRESH itab_header.
itab_fields-tabname = 'PS0192'.
itab_fields-fieldname = 'BAA01'.
itab_fields-selectflag = ' '.
APPEND itab_fields.
itab_fields-tabname = 'RLGRAP'.
itab_fields-fieldname = 'FILENAME'.
itab_fields-selectflag = 'X'.
APPEND itab_fields.
LOOP AT _filename.
itab_values = itab_filename-type.
APPEND itab_values.
itab_values = itab_filename-name.
APPEND itab_values.
ENDLOOP.
CALL FUNCTION 'HELP_VALUES_GET_WITH_TABLE_EXT'
EXPORTING
CUCOL = 0
CUROW = 0
DISPLAY = ' '
FIELDNAME = ' '
TABNAME = ' '
TITLE_IN_VALUES_LIST = ' '
SHOW_ALL_VALUES_AT_FIRST_TIME = ' '
USE_USER_SHRINKING = ' '
titel = _currdir
NO_SCROLL = ' '
NO_CONVERSION = ' '
NO_MARKING_OF_CHECKVALUE = ' '
IMPORTING
index = rov-index
select_value = rov-selvalue
TABLES
fields = itab_fields
select_values = itab_selvals
valuetab = itab_values
HEADING_TABLE =
EXCEPTIONS
field_not_in_ddic = 1
more_then_one_selectfield = 2
no_selectfield = 3
OTHERS = 4.
IF sy-subrc = 0.
CLEAR itab_filename.
READ TABLE itab_filename INDEX rov-index.
IF itab_filename-type+0(3) = 'dir'.
CONCATENATE _currdir rov-delchar rov-selvalue rov-delchar
INTO _selfile.
ELSE.
CONCATENATE _currdir rov-delchar rov-selvalue INTO _selfile.
ENDIF.
ENDIF.
ENDFORM. " help_values_get_with_table_ext
Best regards,
Prashant -
Hello,
I am hoping someone will be able to help me with my query.
I am trying to write an ABAP program which poll a SAP directory and then process the files within this directory.
I am using FM SUBST_GET_FILE_LIST to get the files from the directory but I want to use a logical path (which I have created using the FILE transaction) to specify the location).
So I am looking for another FM which will return the actual directory from the logical path name. The documentation seems to suggest FILE_GET_NAME but I am not sure whether this works with directory paths rather than file locations.
If anyone has any suggestions or some example code of this sort of thing please let me know.
Thanks,
RubyHi Jonathan,
Thanks for your reply.
I have just tried this and I keep getting "Path not found" error.
I have created a logical path within the file transaction which is set to:-
d:\tmp\<FILENAME> (windows server)
The call to the FM looks like:-
CALL FUNCTION 'FILE_GET_NAME_USING_PATH'
EXPORTING
CLIENT = SY-MANDT
LOGICAL_PATH = 'RUBYS_LOGICAL_PATH'
FILE_NAME = 'dummy.dat'
IMPORTING
FILE_NAME_WITH_PATH = file
EXCEPTIONS
PATH_NOT_FOUND = 1
MISSING_PARAMETER = 2
OPERATING_SYSTEM_NOT_FOUND = 3
FILE_SYSTEM_NOT_FOUND = 4
OTHERS = 5
Any ideas on why this is not working?
Thanks,
Ruby
Maybe you are looking for
-
Wrong aspect ratio (4:3) HDV files (16:9)
Hi! I'm using iDVD 5.0.1. My source video is HDV 1080i. iDVD preview shows 16:9 aspect, but my burned DVD disks played in Apple DVD Player and regular DVD players are displaying 4:3 aspect ratio... (on 4:3 and 16:9 TV sets) How can I fix this problem
-
HP Web OS Tablet Problem HP tech support referedme to this site for expert level technician help for my HP Web OS Tablet. The problem is that it does not open and play photos and videos transfered to it from a PC. You can see the files have actually
-
Tethering with Nikon D600 - no camera found!!!!
This is incredibly frustrating to have a $2,000+ camera that cannot connect to Lightroom. It really impacts the value of both Lightroom and my camera if they don't talk to each other. Please advise when you anticipate this being fixed in an update.
-
Why cant I send or receive calls
S4 will not dial out or receive calls. Text and data are fine.
-
I don't know how to hook up our At&t U verse to our iMac/apple computer. Plz Help!
I cant find where to access it. I tried the Airport wireless application and it didnt find it. Plz help !