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

Regarding quantity field...value in layout

Former Member
0 Likes
623

Hi all,

Below is the my code. But i am getting out put as..

100,000, and 200,000, and 300,000 like wise, please let me know what could be the problem here..I think we need to get the value as 100. all this is fkimg field in the program..

please help me out in solving the issue.

REPORT YTEST_VINESH_L1_PRINT_PRG.

TABLES: NAST.

TYPES: BEGIN OF Y_VBRP,

FKIMG TYPE FKIMG,

END OF Y_VBRP.

CONSTANTS: c_space(1) TYPE c VALUE ' ',

c_fonam TYPE tdform VALUE 'YTEST_VINESH_L1',

c_x(1) TYPE c VALUE 'X'.

DATA: T_VBRP TYPE STANDARD TABLE OF Y_VBRP,

E_VBRP TYPE Y_VBRP,

W_FKIMG TYPE I,

e_itcpo LIKE itcpo,

w_prg TYPE sy-repid.

MOVE c_x TO e_itcpo-tdnewid.

MOVE c_x TO e_itcpo-tdpreview.

MOVE nast-ldest TO e_itcpo-tddest.

SELECT FKIMG

FROM VBRP

UP TO 15 ROWS

INTO TABLE T_VBRP.

CALL FUNCTION 'OPEN_FORM'

EXPORTING

dialog = c_space

form = c_fonam

OPTIONS = e_itcpo

EXCEPTIONS

canceled = 1

device = 2

form = 3

OPTIONS = 4

unclosed = 5

mail_options = 6

archive_error = 7

invalid_fax_number = 8

more_params_needed_in_batch = 9

spool_error = 10

OTHERS = 11.

IF sy-subrc NE 0.

ENDIF.

CALL FUNCTION 'START_FORM'

EXPORTING

form = c_fonam

program = w_prg

EXCEPTIONS

form = 1

format = 2

unended = 3

unopened = 4

unused = 5

spool_error = 6

OTHERS = 7.

IF sy-subrc NE 0.

ENDIF.

LOOP AT T_VBRP INTO E_VBRP.

CALL FUNCTION 'WRITE_FORM'

EXPORTING

element = 'ITEM_DETAILS'

window = 'MAIN'

EXCEPTIONS

element = 1

function = 2

type = 3

unopened = 4

unstarted = 5

window = 6

bad_pageformat_for_print = 7

spool_error = 8

codepage = 9

OTHERS = 10.

IF sy-subrc NE 0.

ENDIF.

ENDLOOP.

CALL FUNCTION 'END_FORM'

EXCEPTIONS

unopened = 1

bad_pageformat_for_print = 2

spool_error = 3

OTHERS = 4.

IF sy-subrc NE 0.

ENDIF.

CALL FUNCTION 'CLOSE_FORM'

EXCEPTIONS

unopened = 1

bad_pageformat_for_print = 2

send_error = 3

spool_error = 4

OTHERS = 5.

IF sy-subrc NE 0.

ENDIF.

Regards,

vinesh.

4 REPLIES 4
Read only

valter_oliveira
Active Contributor
0 Likes
596

Hello.

In your script, use &e_vbrp-var(.0)& statement. Here, you are writing variable with 0 decimal places. The syntax is &var(.n)& to n decimal places.

Also, refer this link,

http://help.sap.com/saphelp_nwpi71/helpdata/en/d1/80318f454211d189710000e8322d00/frameset.htm

Regards.

Valtet Oliveira.

Read only

Former Member
0 Likes
596

hai,

this is user specific problem. go to t-su01 --> input the sap user name in which this problem is coming >change>default table and change the output format for displaying.

reward points

thanks'

jase

Read only

Former Member
0 Likes
596

Hi,

What we need to change in user settings..

regards,

vinesh.

Read only

Pawan_Kesari
Active Contributor
0 Likes
596

The amount has to be populated in a structure's amount field and proper currency key in the currency reference field and then using the structure's amount field in the layout set rather than using a global variable of type P.

(e.g. Use of KOMK-FKWRT for populating the amount and KOMK-WAERK for holding the corresponding currency key. This will use the currency reference relation defined in the structure KOMK.)