Application Development 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: 

SmartForms - output field of type Quan

Former Member
0 Kudos

I have a few db fields of type quan that I am trying to put into my form. When I view the output (preview or print) all fields of type quan are right-aligned. I have the paragraph format (via smartstyles) as left-aligned but these fields (and only these fields) are right aligned. Is there any way to get the quan types left-aligned?

Regards,

Davis

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Davis,

Just before specifying the field in the text element, u need the insert a program code line.

Suppose u need to condense itab-vbeln

In the input parameters, give itab

in output parameters give a field quant which has been declared as char type and declared in global definitions.

Add the code as follows

quant = itab-vbeln.

condense quant.

Now pass this variable 'quant' for displaying in the smartform.

Reward points if useful

15 REPLIES 15

amit_khare
Active Contributor
0 Kudos

Pass these fields to Char Variable before displaying.

Then apply your font format.

Regards,

Amit

Reward all helpful replies.

Former Member
0 Kudos

Hi,

You need to move these fields to a Charecter type fields then print those charecter fields then it will be left aligned

Regards

Sudheer

Former Member
0 Kudos

Thanks to both of you. I'm going to try that now.

Regards,

Davis

0 Kudos

before displaying the quantity field in the Test Node add a Program lines code and write something like this -

move itab-quan to v_quan.

import parameters - v_quan & itab-quan

export - v_quan.

in global data: difine v_quant as char10.

Regards,

Amit

0 Kudos

Amit, thanks for the reply.

I tried that and I am still getting the same error "Field GS_VBLKP-LFIMG is unknown".

For some reason every time I try to use GS_VBLKP_LFIMG in a Program Lines node I get an error on that field.

Regards,

Davis

Former Member
0 Kudos

I tried your solution, in a Program Lines node, and I got a syntax error. The error says "Field &GS_VBLKP-LFIMG& is unknown. I am using this field all over my form but it doesn't like it here. Below is the code that I put in the Program Lines node:

w_lfimg = &gs_vblkp-lfimg&.

Regards,

Davis

Message was edited by:

Davis

ferry_lianto
Active Contributor
0 Kudos

Hi,

Please try something like this and define v_kbetr as a charecter type.


&v_kbetr(L)& 

Regards,

Ferry Lianto

0 Kudos

Hi Ferry,

I am having trouble betting the value into a character field. Please see my post above. When I try to use the field &GS_VBLKP-LFIMG& I get a syntax error (only in a Program Lines node).

Regards,

Davis

ferry_lianto
Active Contributor
0 Kudos

Hi,

Please try this.


data: w_lfmig(13) type c.

w_lfimg = gs_vblkp-lfimg.

...
&w_lfmig(L)& 

Regards,

Ferry Lianto

0 Kudos

Ferry,

It still gives me a error saying that "Field GS_VBLKP-LFIMG is unknown". I don't understand this because I am using this field in other parts of my form (but only in text nodes). Should I not put this in a Program Lines node?

Regards,

Davis

ferry_lianto
Active Contributor
0 Kudos

Hi Davis,

Did you declare gs_vblkp-lfimg in global data?

Regards,

Ferry Lianto

0 Kudos

Ferry,

I have GS_VBKLP (a work area for VBLKP) declared as a global type.

Regards,

Davis

0 Kudos

Hi davis,

import and export this variable 'gs_vblkp-lfimg ' in the program lines i.e mention this variable in input and output parameters.

Regards,

Vidya.

Former Member
0 Kudos

Hi Davis,

Just before specifying the field in the text element, u need the insert a program code line.

Suppose u need to condense itab-vbeln

In the input parameters, give itab

in output parameters give a field quant which has been declared as char type and declared in global definitions.

Add the code as follows

quant = itab-vbeln.

condense quant.

Now pass this variable 'quant' for displaying in the smartform.

Reward points if useful

0 Kudos

Anoop,

Thank you so much for that post! That did the trick. I forget to add input and output parameters because the window is centered and the input and output parameters do not show unless you scroll up. Thanks so much for your help!

Regards,

Davis