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

problem job/submit a FM

former_member582701
Contributor
0 Likes
699

Hi!

I have this code:

SELECT SINGLE PROCPROG JOBNAME

INTO (lv_procprog, lv_jobname)

FROM ZGL_MPF_CONFIG

WHERE interfacename = INTERFACENAME.

CALL FUNCTION 'JOB_OPEN'

EXPORTING

jobname = lv_jobname

IMPORTING

JOBCOUNT = lv_jobcount.

.

SUBMIT (lv_procprog)

USER SY-UNAME

VIA JOB lv_jobname

NUMBER lv_jobcount

WITH PATH EQ 'C:\DOWNLOAD2.TXT'

AND RETURN.

CALL FUNCTION 'JOB_CLOSE'

EXPORTING

jobcount = lv_jobcount

jobname = lv_jobname

STRTIMMED = 'X'

.

The program dump in SUBMIT (lv_procprog) line. SAP tells z_interface (procprog value) doesn't exist but it is a FM that exists and is actived. Do you see any mistake? z_interface receive a path where write a file.

Thx

1 ACCEPTED SOLUTION
Read only

former_member582701
Contributor
0 Likes
674

Maybe submit is waiting a report instead of a Function module?

How i can solve this?

Hi!

I have this code:

SELECT SINGLE PROCPROG JOBNAME

INTO (lv_procprog, lv_jobname)

FROM ZGL_MPF_CONFIG

WHERE interfacename = INTERFACENAME.

CALL FUNCTION 'JOB_OPEN'

EXPORTING

jobname = lv_jobname

IMPORTING

JOBCOUNT = lv_jobcount.

.

SUBMIT (lv_procprog)

USER SY-UNAME

VIA JOB lv_jobname

NUMBER lv_jobcount

WITH PATH EQ 'C:\DOWNLOAD2.TXT'

AND RETURN.

CALL FUNCTION 'JOB_CLOSE'

EXPORTING

jobcount = lv_jobcount

jobname = lv_jobname

STRTIMMED = 'X'

.

The program dump in SUBMIT (lv_procprog) line. SAP tells z_interface (procprog value) doesn't exist but it is a FM that exists and is actived. Do you see any mistake? z_interface receive a path where write a file.

Thx

4 REPLIES 4
Read only

former_member582701
Contributor
0 Likes
675

Maybe submit is waiting a report instead of a Function module?

How i can solve this?

Read only

0 Likes
674

Hi,

1. What u can do list.

Get all the variant of the standard report and

data: variant(14).

variant = 'VARIANT1'. " Based on ur condition change the value to the variable

SUBMIT REPORT01

VIA SELECTION-SCREEN

USING SELECTION-SET VARIANT "Check here

USING SELECTION-SETS OF PROGRAM 'REPORT00'

AND RETURN.

2 .Use the fm: RS_VARIANT_CONTENTS to get the values of the different values in the screen.

move those values to screen fields in the INITIALIZATION event

<b>Reward points</b>

Regards

Read only

0 Likes
674

Hello,

Make a report which calls the function module and specify the same function parameters as selection screen parameters in the program

Read only

former_member189059
Active Contributor
0 Likes
674

Hello Manel,

This is what SAP help states

The SUBMIT statement accesses an executable <b>program</b> rep. The executable program is executed as described under Calling Executable Reports.

The program name rep can either be specified directly or as the content of a character-like data object name. The data object name must be the name of the program to be accessed in <b>block capitals</b>. IF the program specified name is not found, an irretrievable exception is generated

1. make sure the name is in capitals

2. i am not sure if you can submit a function module as a job