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

Issue in data types for SAP Function Module (SCMS_ARCHIVE_INFO_GET)

Former Member
0 Likes
1,879

Hello Gurus,

I m facing a starnge issue. I am using aFunbction module, 'SCMS_ARCHIVE_INFO_GET' to get the detail of content repository setup in SAP.

Now in this function module the export parameters, BASICPATH and ARCHIVPATH are defined as type 'C'. But when I execute the FM, I see the datatype for these fields and some others which are defined as Type C, gets changed to Type C(200) in the ABAp debugger. This FM test execution is successful.

But when the background user tries to use the same FM in a program during debugging, the data type remains Type C as defined in FM export parameters and the FM execution terminates.

Can someone tell me why is the difference and what do I need to do make sure that the data type does change to C(200) and does not remain TyPE C becasue then it fails.

Regards,

Tushar.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,464

Specify a length of your variables of 1024.

Rob

Hello Gurus,

I m facing a starnge issue. I am using aFunbction module, 'SCMS_ARCHIVE_INFO_GET' to get the detail of content repository setup in SAP.

Now in this function module the export parameters, BASICPATH and ARCHIVPATH are defined as type 'C'. But when I execute the FM, I see the datatype for these fields and some others which are defined as Type C, gets changed to Type C(200) in the ABAp debugger. This FM test execution is successful.

But when the background user tries to use the same FM in a program during debugging, the data type remains Type C as defined in FM export parameters and the FM execution terminates.

Can someone tell me why is the difference and what do I need to do make sure that the data type does change to C(200) and does not remain TyPE C becasue then it fails.

Regards,

Tushar.

8 REPLIES 8
Read only

Former Member
0 Likes
1,465

Specify a length of your variables of 1024.

Rob

Read only

0 Likes
1,464

Can you please elaborate ? What do you mean by specify length of variable as 1024. This is a standard FM which is used inside another FM 'ARCHIV_PROCESS_FAXINPUT'.

This is how data is passed inside the FM:

if archiv_id ne space.

call function 'SCMS_ARCHIVE_INFO_GET'

exporting

arc_id = archiv_id

IMPORTING

VERSION = version

EXCEPTIONS

ERROR_CONFIG = 1

OTHERS = 2

.

if sy-subrc ne 0.

status = nothing_done.

message e507 raising no_workitem_created.

endif.

endif.

Regards,

Tushar.

Read only

0 Likes
1,464

But it doesn't pass either of the two parameters you are asking about.

Rob

Read only

0 Likes
1,464

Yes, it doesn't pass the two parameters, but due to that, the file path remains Type C due to which during following form routine, it gives error in CALL METHOD CL_GUI_FRONTEND_SERVICES=>GET_PLATFORM since its background user since the variable 'file' only copies first alphabet of complete file path and hence it reaches the above FM during which it fails....

perform check_and_add_delimiter in program scms using file.

Read only

0 Likes
1,464

Well, methods of class CL_GUI_FRONTEND_SERVICES cannot be called in the background. The GUI is not available.

Rob

Read only

0 Likes
1,464

I guess, I have to copy this FM in ZFM and pass the parameters, its not passing in standard SAP FM....

Regards,

Tushar.

Read only

0 Likes
1,464

You still won't be able to access the GUI in the background.

You have said what your error is, but you haven't said what you are trying to do. That might help.

Rob

Read only

0 Likes
1,464

The issue is with SAP function module. In ZFM I was able to solve issue. Since now the correct data type is passed ebcause I pass the export parameter to SCMS function module.

In SAP, it was not passed. Since data type was not passed, SAP was excuting condition for GUI class and hence the issue. I am planning to create OSS not and tell SAP how they should do it...

call function 'SCMS_ARCHIVE_INFO_GET'

exporting

arc_id = archiv_id

IMPORTING

VERSION = version

BASICPATH = V_BASICPATH

ARCHIVPATH = V_ARCHIVPATH

SPOOLPATH = V_SPOOLPATH

PHYS_BASICPATH = V_PHYS_BASICPATH

PHYS_ARCHIVPATH = V_PHYS_ARCHIVPATH

EXCEPTIONS

ERROR_CONFIG = 1

OTHERS = 2

.

Hence the condition for if-endif for GUI forntend class in this FM does not execute and I am able to it successfully as I wanted. I just tested...

Regards,

Tushar.

Edited by: Tushar Shah on Jun 13, 2011 6:43 PM

Edited by: Tushar Shah on Jun 13, 2011 6:45 PM