cancel
Showing results for 
Search instead for 
Did you mean: 

Problem while displaying Amount Field (BETRG)

Former Member
0 Kudos

Hi,

I am trying to display the amount field (betrg field). I have extracted the payroll results. I can see the right value in the work area of the RT table (w_rt-betrg) but when I move it to another work area for display purpose, it is not the right value.

w_rt-betrg = 1234.50

MOVE w_rt-betrg TO w_det-betrg.

If in the above statement, w_det-betrg is type c, then w_det-betrg is getting ' * ' as its value.

If w_det-betrg is of type n, then the value is incorrect, e.g., 4

I am not knowing the right procedure to declare the amount field before moving them to another work area. Can someone help me on this?

Thanks,

Anjana

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

If this is regarding declaring the BETRG field in your WA. Why don't you declare WA-BETRG TYPE BETRG..

If still having problem, can you please copy paste your code for better understanding of the problem.

Regards,

Dharitree

Former Member
0 Kudos

Hi Dharitri,

Thanks for the reply.

I have tried to declare the work area as type betrg. It doesnt work as I need all the fields as type c to push the file to the application server. I am doing an outbound interface.

I have explained the scenario with the code below.

  • I am moving all the required fields for the detail record in the w_detail work area.

MOVE w_rt-lgart TO w_detail-lgart.

MOVE w_512t-lgtxt TO w_detail-lgtxt.

MOVE w_rt-betrg TO w_detail-betrg.

(( At this point, when I debug, I can see the right amount in w_rt-betrg which is 1224.50. But with the move statement, w_detail-betrg is gettting ' * ' . Because I have declared w_detail-betrg as type c. If i declare that as type n, it is taking only few digits giving incorrect amount. It doesnt allow me to declare w_detail-betrg as type betrg, it comes up with the message that w_detail-betrg should be either type c or n or i coz I am pushing it to the w_file which should be of type c. ))

  • And then I am concatenating all the fields into a file.

CONCATENATE w_detail-lgart w_detail-lgtxt w_detail-betrg INTO w_file SEPARATED BY ' '.

  • Then I am appending this to an internal table which will be transferred to the application server.

APPEND w_file TO t_file.

CLEAR w_file.

  • Once I have this internal table filled with all the header, detail and footer fields, I will be using OPEN DATASET, CLOSE DATASET to transfer the file to the application server.

Please guide me more on this.

Thanks,

Former Member
0 Kudos

Hi,

I tried in test program and it is working for me.

I have declared BETRG(18) TYPE C in my work area where I am moving the values. If still not working you can use WRITE ... CURRENCY instead of MOVE statement for BETRG.

Regards,

Dharitree

Former Member
0 Kudos

Thanks a lot Dharitri,

I had missed to give the length in my declaration.

Now it is working fine.

But can you tell me how to shift the value to the left, coz there is lot of gap before the amount value.

See the output below. I dont want to have that gap before the amount.

00000044 /102 Regular taxable income .... 3846.15

      • I have put dots there to show you where the gap is coming..

Message was edited by:

Anjana Batchu

Former Member
0 Kudos

Hi,

Use CONDENSE operation.

Dharitree

Former Member
0 Kudos

Yes. It worked.

Thanks a lot for your timely help.

Anjana

Answers (0)