Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Problem in DME file generation

Former Member
0 Likes
2,238

Hi experts,

I am facing a problem in the generation DME file. Required file format for SPAIN is different to that of the standard file that is generated by executing the standard program RFFOES_T. So I copied that standard program into another and made changes for the new file format in the subroutine DTA_SPANIEN. The file is being generated but with systematically 7 white lines (i.e) blank lines between 2 real lines. Cannot find where the problem lies. Can any one help me in this? Thanks in advance.

Regards,

Asha

1 ACCEPTED SOLUTION
Read only

former_member182371
Active Contributor
0 Likes
1,993

Hi Asha,

i had a similar problem and i solved it adding these two lines as the two last fields of the internal table:

<b>fin(1) TYPE X VALUE '0D',

CRLF(2) TYPE C VALUE cl_abap_char_utilities=>cr_lf,</b>

Best regards

Hi Asha,

i had a similar problem and i solved it adding these two lines as the two last fields of the internal table:

<b>fin(1) TYPE X VALUE '0D',

CRLF(2) TYPE C VALUE cl_abap_char_utilities=>cr_lf,</b>

Best regards

10 REPLIES 10
Read only

suresh_datti
Active Contributor
0 Likes
1,993

Hi Asha,

Did you try to debug the Program? What changes did you make in DTA_SPANIEN? Put a break-point inside the DO loop & check out.. Also checking if REGUH is initial before calling the WRITE_FORM might help..

Regards,

Suresh Datti

Read only

0 Likes
1,993

Hi Suresh,

Thansk for your reply for my query. I have debugged it lot many times. What Do loop are you talking about? As my records of the DME file expected are of different structure I have used extracts and in DTA_SPANIEN subroutine I have filled the records of different stucture into a internal table which has a field of type string and transferred the internal table contents to file by looping and transferring. REGUH is not intital. I have checked it.

Regards,

Asha

Read only

former_member182371
Active Contributor
0 Likes
1,994

Hi Asha,

i had a similar problem and i solved it adding these two lines as the two last fields of the internal table:

<b>fin(1) TYPE X VALUE '0D',

CRLF(2) TYPE C VALUE cl_abap_char_utilities=>cr_lf,</b>

Best regards

Read only

0 Likes
1,993

Hi Calsadillo,

The below code says how I have passed the different records to the file

types: begin of t_file,

record(1000),

end of t_file,

begin of t_h1,

rec(2),

trans(2),

field1(10),

crtd(6),

end of t_h1,

begin of t_h2,

rec(2),

trans(2),

paynm(6),

end of t_h2,

begin of t_h3,

rec(2),

trans(2),

payadd(35),

filler(2),

field2(40),

end of t_h3,

begin of t_h4,

rec(2),

trans(2),

matdat(6),

deltype,

contype(2),

filler(7),

end of t_h4.

data : lwa_h1 type t_h1,

lwa_h2 type t_h2,

lwa_h3 type t_h3,

lwa_h4 type t_h4,

lwa_file type t_file.

data : li_file type standard table of t_file.

*Start Filling Record 1

l_count = l_count + 1.

lwa_h1-rec = lc_03.

lwa_h1-trans = lc_56.

lwa_h1-field1 = t001z-paval.

lwa_h1-crtd = '0000000O02XR'.

lwa_file = lwa_h1.

APPEND lwa_file TO li_file.

*Start Filling Record 2

l_count = l_count + 1.

lwa_h2-rec = lc_03.

lwa_h2-trans = lc_56.

lwa_h2-paynm = t001-butxt.

lwa_file = lwa_h2.

APPEND lwa_file TO li_file.

*Start Filling Record 3

l_count = l_count + 1.

lwa_h3-rec = lc_03.

lwa_h3-trans = lc_56.

lwa_h3-payadd = adrc-city1.

lwa_h3-filler = lc_06.

lwa_file = lwa_h4.

APPEND lwa_file TO li_file.

*Start Filling Record 4

l_count = l_count + 1.

lwa_h4-rec = lc_03.

lwa_h4-trans = lc_56.

lwa_h4-matdat = lc_030.

lwa_h4-deltype = lc_004.

lwa_h4-contype = lc_003.

lwa_file = lwa_h3.

APPEND lwa_file TO li_file.

OPEN DATASET par_unix FOR OUTPUT IN LEGACY TEXT MODE

IGNORING CONVERSION ERRORS.

IF sy-subrc IS INITIAL.

LOOP AT li_file INTO lwa_file.

TRANSFER lwa_file TO par_unix.

ENDLOOP.

CLOSE DATASET par_unix.

ENDIF.

where par_unix is the file name entered on the selection screen.

Now where can i fit the two declarations of code which you have sent? Can you please explain.

Regards,

Asha

Read only

former_member182371
Active Contributor
0 Likes
1,993

Hi,

try with:

types: begin of t_file,

record(1000),

CRLF(2) TYPE C VALUE cl_abap_char_utilities=>cr_lf,

end of t_file,

begin of t_h1,

rec(2),

trans(2),

field1(10),

crtd(6),

CRLF(2) TYPE C VALUE cl_abap_char_utilities=>cr_lf,

end of t_h1,

begin of t_h2,

rec(2),

trans(2),

paynm(6),

CRLF(2) TYPE C VALUE cl_abap_char_utilities=>cr_lf,

end of t_h2,

begin of t_h3,

rec(2),

trans(2),

payadd(35),

filler(2),

field2(40),

CRLF(2) TYPE C VALUE cl_abap_char_utilities=>cr_lf,

end of t_h3,

begin of t_h4,

rec(2),

trans(2),

matdat(6),

deltype,

contype(2),

filler(7),

CRLF(2) TYPE C VALUE cl_abap_char_utilities=>cr_lf,

end of t_h4.

and check the result.

CRLF stands for "Carriage Return Line Feed".

Best regards.

Read only

0 Likes
1,993

Hi Calsadillo,

Its the same again with no change. The file is being generated 7 white lines (i.e) blank lines between 2 real lines.

Regards,

Asha

Read only

former_member182371
Active Contributor
0 Likes
1,993

Hi Asha,

if seems clear that the flow of the program is inserting lines and you don´t want them. You have to find the exact place in the code where those lines are inserted and comment them.

Besides have a look at this:

  • Record counter for the following fields:

  • - dtaxestot-f2 ( Numeros de registros de dato 010).

  • - dtaxestot-f3 ( Numeros de registros totales).

DATA:

DTA_CNT_SAETZE_F2(5) TYPE P,

DTA_CNT_SAETZE_F3(5) TYPE P.

Numeros de registros de dato 010 = number of lines of data 010

Numeros de registros totales = number of total lines

Best regards

Read only

former_member182371
Active Contributor
0 Likes
1,993

Hi Asha,

in my program in PERFORM CAB_ORD_FUELLEN i added something like:

CASE reguh-ubnkl.

WHEN '00XXXXXX'.

schcheader-codreg = '1'.

schcheader-codcli = 'XXX'.

schcheader-nbclor = t001-butxt.

schcheader-fremes = sy-datum.

schcheader-refrem(7) = 'Remesa/'.

schcheader-refrem+7(8) = sy-datum.

schcheader-moneda = reguh-waers(3).

  • optional fieds

schcheader-rvado1 = space.

schcheader-rvado2 = space.

schcheader-rvado3 = space.

schheader-filler = space.

PERFORM STORE_ON_FILE USING schcheader.

DTA_CNT_SAETZE_F3 = DTA_CNT_SAETZE_F3 + 1.

ENDCASE.

Where schcheader is a structure containing the file of the format the bank wants to receive.

Best regards

Read only

Former Member
0 Likes
1,993

Hello Asha,

U have 4 records, which are getting output along with the blank lines?

Read only

Former Member
0 Likes
1,993

Hi,

I hope you have already used DME control.

could u pls guide me how to create files according to bank standards.

Looking forward to ur reply

asad