2014 Mar 12 12:23 PM
Hello experts,
I am currently working on the Product Management System hierarchy. In which we are maintaining
I am getting a bit problem while creating version. We have a screen like
From which we used to create version. Logic behind the screen is
VERSION = LATEST VERSION
Next what i want to do is get next version to latest version in the box near VERSION. In this case the box should display 0.0.4 instead of 0.0.3. For this I have used logic as
VERSION = LATEST VERSION + 1.
Its working absolutely fine, just getting problem on the screen as below
The box displaying ..4 instead of 0.0.4. If you have any idea how to achieve this please share it with me.
Thanks,
Avadhut
2014 Mar 12 1:01 PM
Hi Avadhut,
Could you tell us what are your fields VERSION and LATEST VERSION type?
Best Regards
Hello experts,
I am currently working on the Product Management System hierarchy. In which we are maintaining
I am getting a bit problem while creating version. We have a screen like
From which we used to create version. Logic behind the screen is
VERSION = LATEST VERSION
Next what i want to do is get next version to latest version in the box near VERSION. In this case the box should display 0.0.4 instead of 0.0.3. For this I have used logic as
VERSION = LATEST VERSION + 1.
Its working absolutely fine, just getting problem on the screen as below
The box displaying ..4 instead of 0.0.4. If you have any idea how to achieve this please share it with me.
Thanks,
Avadhut
2014 Mar 12 1:01 PM
Hi Avadhut,
Could you tell us what are your fields VERSION and LATEST VERSION type?
Best Regards
2014 Mar 12 1:19 PM
Hi Adrián Mejido ,
Both are CHAR 6. I have debugged the code i observed that when I retrieve LATEST VERSION from table then its value is like 000001 (e.g.). But when i add 1 to this value means for step
VERSION = LATEST VERSION + 1. then it will become 2 and so on. I want 000002 instead of just 2. Do you have any idea what is to be done?
Thanks,
Avadhut
2014 Mar 12 1:39 PM
Hi Advadhut,
After add 1 to the version, use the FM 'CONVERSION_EXIT_ALPHA_INPUT' .
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
INPUT = VERSION
IMPORTING
OUTPUT = VERSION.
Best Regards
2014 Mar 12 1:47 PM
Hi Adrián Mejido,
Thanks for info its working but not absolutely. If LATEST VERSION is 0.0.9 then it should propose 0.1.0 in the box but instead its displaying 0.0.10.
2014 Mar 12 3:48 PM
Hi Avadhut,
Obviously, that is a bit difficult, this code should work.
DATA: LASTVERSION_h(2),
LASTVERSION_m(2),
LASTVERSION_l(2),
VERSION_h(2),
VERSION_m(2),
VERSION_l(2).
SHIFT LASTVERSION RIGHT DELETING TRAILING SPACE.
CLEAR: LASTVERSION_h,
LASTVERSION_m,
LASTVERSION_l,
VERSION_h,
VERSION_m,
VERSION_l.
LASTVERSION_h = LASTVERSION(2).
LASTVERSION_m = LASTVERSION+2(2).
LASTVERSION_l = LASTVERSION+4(2).
IF LASTVERSION_l <= 8.
VERSION_L = LASTVERSION_l + 1.
VERSION_M = LASTVERSION_M.
VERSION_H = LASTVERSION_H.
ELSEIF LASTVERSION_m <= 8.
VERSION_M = LASTVERSION_m + 1.
VERSION_H = LASTVERSION_H.
ELSEIF LASTVERSION_h < 8.
VERSION_h = LASTVERSION_h + 1.
ENDIF.
IF VERSION_L IS INITIAL.
VERSION_l = '0'.
ENDIF.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
INPUT = VERSION_L
IMPORTING
OUTPUT = VERSION_L.
IF VERSION_m IS INITIAL.
VERSION_m = '0'.
ENDIF.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
INPUT = VERSION_M
IMPORTING
OUTPUT = VERSION_M.
IF VERSION_h IS INITIAL.
VERSION_h = '0'.
ENDIF.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
INPUT = VERSION_H
IMPORTING
OUTPUT = VERSION_H.
CONCATENATE VERSION_H VERSION_M VERSION_L INTO VERSION.
SHIFT LASTVERSION RIGHT DELETING TRAILING SPACE.
CLEAR: LASTVERSION_h,
LASTVERSION_m,
LASTVERSION_l,
VERSION_h,
VERSION_m,
VERSION_l.
LASTVERSION_h = LASTVERSION(2).
LASTVERSION_m = LASTVERSION+2(2).
LASTVERSION_l = LASTVERSION+4(2).
IF LASTVERSION_l <= 8.
VERSION_L = LASTVERSION_l + 1.
VERSION_M = LASTVERSION_M.
VERSION_H = LASTVERSION_H.
ELSEIF LASTVERSION_m <= 8.
VERSION_M = LASTVERSION_m + 1.
VERSION_H = LASTVERSION_H.
ELSEIF LASTVERSION_h < 8.
VERSION_h = LASTVERSION_h + 1.
ENDIF.
IF VERSION_L IS INITIAL.
VERSION_l = '0'.
ENDIF.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
INPUT = VERSION_L
IMPORTING
OUTPUT = VERSION_L.
IF VERSION_m IS INITIAL.
VERSION_m = '0'.
ENDIF.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
INPUT = VERSION_M
IMPORTING
OUTPUT = VERSION_M.
IF VERSION_h IS INITIAL.
VERSION_h = '0'.
ENDIF.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
INPUT = VERSION_H
IMPORTING
OUTPUT = VERSION_H.
CONCATENATE VERSION_H VERSION_M VERSION_L INTO VERSION.
Best Regards and don't forget to rate me please
2014 Mar 14 9:57 AM
Hi Adrián Mejido,
I have done with the desired requirement. Thanks for the FM info.
2014 Mar 12 4:07 PM
Hello Avadhut,
1) Try by declaring the VERSION of type NUM06.
OR
2) Use a data element in which the domain has a conversion routine in it.
Regards,
TP
2014 Mar 14 10:00 AM
Hi Thanga Prakash,
Thanks for reply. The version was already defined by other developer in tables. So it would be better to convert it into program instead of replacing in all the tables.