cancel
Showing results for 
Search instead for 
Did you mean: 

display key and text in dropdown box & suppress leading zeros in material #

Former Member
0 Kudos

Hi Everyone,

I have some questions on how to .... Can anyone help me? Here they are:

How to show material # and description (key and text) both in dropdown box list?

How to suppress leading zeros in material #, i.e. 0000000012345678 only show 12345678 ?

How to show a date with format mm/dd/yyyy not yyyymmdd?

Thanks alot, Jin

Edited by: Jin Freda on Mar 25, 2008 4:47 PM

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Thank You ALL very very much for all your information and great help, I would like give you all 6 points, but somehow it does not allow me (sorry about it).

Thanks Deepika for your codings, could you please tell me where I should put them?

Thanks Ahmed for the info, but I don’t have date picker for control type.

Thanks Govindu again for your info, but Date fomatting is still not available even for Date type fileds /check in Text type field. Also, to suppress leading 0s: when puting ROUND(@Material) formula in default value I am getting error. Could you please advise?

Thanks all again, Jin

Former Member
0 Kudos

Hi,

What type control you are useing for date .

If you are useing Input field of date type or Date picker control you should get this option in the control properties.

Can you tell me what are tabs are appaering in the conrtol properties.

2.When you you are using the formula Round(@material) ,Are you typing it or draging Field from right side in to the formula .If you did not drag it you will get Message:Formula has errors.

One more probelm is there if the Data type of field where you using formula is not Number type.

Check all above and get back to me.

3.You are not able to give 6 points for all because its a resrticed one you execeded giving6 points option now you can give only 10 points.

Regards,

GOVINDU

Answers (9)

Answers (9)

Former Member
0 Kudos

Thanks again for your time and great help.

Just fyi, I created 2 new threads for suppress leading zeros and Date format.

Thanks, Jin

Former Member
0 Kudos

Thanks Govindu,

We are on SP14 client version is 700.14.0.1

Just for a clarification, if all the data types are Text('T') ,You will NOT get the format for date, is it right?

Following your direction, I can add Date picker in configuration panel and see Date Format in Formatting tab.

Thanks, Jin

Former Member
0 Kudos

Hi,

if all the data types are 'T',u will not get date fromate:-)

Regards,

Govindu

Former Member
0 Kudos

Hi Govindu,

Thank you so much for your time and great help. To answer your questions:

1) Type control I’m using for date is Input Field (Date picker is not available for me, why?), but I only get Text Format. I just realized that all data types are “T” in VC even for those data type in BW are Date, maybe this is why I don’t get Date format? If it’s true, I should create new Thread for how to bring BW Date in VC as a Date not Text, so I can reward more points

I have General, Display, Formatting, Validation and Action tabs in control properties

2) I did drag material in formula Round(@material). But you are right Material is not number is character, so that means I can’t suppress the leading 0s?

3) 10 points are rewarded, but I don’t know how to reward you next time.

Thanks a lot again, Jin

Former Member
0 Kudos

Hi Jin,

On Which SP you are working ?

1.Yes u are correct if all the data types are Text('T') ,You will get the fromate for date because it will be available for Only for date type.

.Where you are looking for Dtae picker?

Click on the form then go to configuration panel on right hand side ,then come to Down of right side you will see +,-- Buttons ,click on + to add the Control then check for date picker there if it is not listed then its a bug .

2.may be,i amnot sure.

Regards,

Govindu

Former Member
0 Kudos

Hi,

This is the code for getting the date in mm/dd/yyyy.I think it is useful for you.

-


data: date type string,

month type string,

year type string,

date1 type string.

date = sy-datum+6(2).

month = sy-datum+4(2).

year = sy-datum+0(4).

concatenate month '/' date '/' year into date1.

write: date1.

Former Member
0 Kudos

Hi,

this code is used for supressing the 0's. I think it is useful for you.

-


parameters material(10) type n.

data: v_matnr(10) type c.

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'

EXPORTING

INPUT = material

IMPORTING

OUTPUT = v_matnr

.

write: / v_matnr.

Former Member
0 Kudos

Dear Jin,

for the first issues :

You have to change the type of the field to date picker

Right click on the input field --> properties --> Under genrals tab change the control type to date picker then you can go to formatting and choose the required date format.

for the second issue add the expression ROUND(1) this will round the value to the nearest 1 once you select the Round(n) expression change the n to 1 and then click check a message will be displayed the expression is valid, you are good to go.

Regards,

Ahmed

Former Member
0 Kudos

Hi Govindu,

Thank you so much for your great help (rewareded you points). I'm new in VC, so could you please give me more advise:

for 3rd question: I only see Text format not Date format from Formatting tab, could you please advise how to correct it:?

for 2nd question:

I can find ROUND(n) formula not ROUND(@yournumber) and Material can have number and character and Field name is Material. Could you please advise what I should write this formula exactly for this case (I tried ROUND(Material) and got error)? Also, just put the formula in Default value is good enough?

Thanks again, Jin

Former Member
0 Kudos

Hi,

For 3rd question.

Date fomatting will be available for Date type fileds only you are trying to check in Text type field.

Adda date type input field,then go for formmating tab and select the reqiured formate there.

For 2nd Qusetion.

First the data type of the field should be Number.

After darging the Formula ROUND(n) ,Replace n with your field by dragging it from right side in the lsit of data fields.

Put that formula in Default value.

after entering the value at run time click enter you willl get the value without zeros.

Regards,

Govindu

.

Former Member
0 Kudos

Thanks Ahmed for your very helpful answer for the 1st question. I gave you the reward points for your help and Thank you.

Any suggestion / help on other 2 questions?

Former Member
0 Kudos

Hi ,

For 3rd Qusetion.

You have to select the formatting Jan 31,2001 from the Formatting tabin the control properties of ur Control.

For 2nD Qusetion.

Use ROUND(@yournumber) formula in the Default value field of general Tab in its control properties.

Regards,

Govindu

If helpful award pionts.

Former Member
0 Kudos

Dear Jin,

if you want to have the code and the value appear please use the Combo box there is no way you can make them both appear in a drop down list.

Regards,

Ahmed