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 System fields

Former Member
0 Likes
771

Dear guys,

Do we have any System field to retrieve the system Basis Version.

ie..to check whether the system is 46D or 620 Basis version.

How to do you..could somebody help on this.

Ambichan

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
698

Hi!

look at the field <b>sy-saprl</b>.

Regards

Kyung woo.

5 REPLIES 5
Read only

Former Member
0 Likes
699

Hi!

look at the field <b>sy-saprl</b>.

Regards

Kyung woo.

Read only

0 Likes
698

hey,

thanks for your reply.

actually i want my program to work in 46B and 620Basis system with same piece of code.

so i used below statement.

If SY-SAPRL < 620.

OPEN DATASET FPATH FOR APPENDING IN TEXT MODE.

Else.

OPEN DATASET FPATH FOR APPENDING IN TEXT MODE ENCODING DEFAULT.

Endif.

But In 46B it gives Compile error.Any idea.

How to solve this issue..

ambichan.

Read only

0 Likes
698

Hi~ ambi

You need to explain more detail what you want~

I thougt you had an answer for your previous question.

I think SY-SAPRL works at 46B,46C, 620 basis.

Anyway, you said your code has compile error.

what's <b>encoding default</b>. I couldn't find any help file for that.

why don't you get rid of encoding default~

It works after getting rid of the code 'encoding default'.

regards

kyung woo

Read only

0 Likes
698

Hello,

Your syntax error is to be expected. The statement you have written in the else part of your code -

OPEN DATASET FPATH FOR APPENDING IN TEXT MODE ENCODING DEFAULT

is not applicable for a 46B system. That is becasue, the ENCODING addition will not be available in 46B and the system will give you a syntax error.

Hope you are able to see the point.

In this case, you will not be able to write a program that works on both 46B and 620 Basis systems.

At best, you can write another program in your 620 Basis system.

Regards,

Anand Mandalika.

Read only

sridevi_p
Active Contributor
0 Likes
698

Hi,

To check the basis version - check the following code

DATA: it_comptab LIKE TABLE OF spam_cvers.

data: wa_comptab LIKE spam_cvers.

CALL FUNCTION 'OCS_GET_INSTALLED_COMPS'

TABLES

tt_comptab = it_comptab

EXCEPTIONS

no_release_found = 1

wrong_release = 2

OTHERS = 99.

.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

read table it_comptab into wa_comptab with key component = 'SAP_BASIS'.

write:wa_comptab-component.

write wa_comptab-release.

In the above code, the output will be -

SAP_BASIS 46C

with this code, try comparing the basis version with the variable wa_comptab-release.

Hope this code helps ur problem.

Revert in case of any issues else award points.

Regards,