Application Development 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: 

Problem with Submit

Former Member
0 Kudos

I've developed a program that calls program RM06BA00 and automatically populates the selection criteria of this program. Program RM06BA00 is doing an export of its internal table which is what I need. Then I will import this internal table into my program and do some more filtering.

My code:

SUBMIT rm06ba00 AND RETURN EXPORTING LIST TO MEMORY 
      WITH ba_banfn IN r_banfn 
      WITH ba_ekgrp IN r_ekgrp 
      WITH ba_matnr IN r_matnr 
      WITH ba_matkl IN r_matkl 
      WITH s_werks  IN r_werks 
      WITH s_lfdat  IN r_lfdat 
      WITH s_frgdt  IN r_frgdt 
      WITH s_flief  IN r_flief 
      WITH p_afnam  = preq_name 
      WITH p_txz01  = short_text 
      WITH p_zugba  = open 
      WITH p_erblba = closed 
      WITH p_bstba  = open 
      WITH p_freig  = closed 
      WITH p_selgs  = open 
      WITH p_selpo  = open 
      WITH s_kostl  IN r_kostl 
      WITH s_aufnr  IN r_aufnr. 

  IMPORT BAN COM FROM MEMORY ID 'ZYX'.

In standard SAP Code:

Program RM06BA00 calls SAPMF06B

PERFORM SUBMIT(SAPFM06B) USING SUCOMM

.

Then program SAPFM06B calls RM06BL00

SUBMIT RM06BL00 AND RETURN.

As shown in the codes above, program (RM06BA00) calls program SAPFM06B which is where it does the export. Then this second program calls program RM06BL00 to display the output. My problem is that I don't need program RM06BL00. How do I exclude this program? Is there any way to suppress the display output?

Any other suggesstions are highly appreciated.

Thanks in advance!

18 REPLIES 18

Former Member
0 Kudos

The best thing would to be to make a 'Z' copy of SAPMF06B that doesn't do the extra submit. In your Z program, you could try setting sy-batch to 'X' if it's not already in the background. It would still submit the report, but to the spool. Probably not a good idea. Make the copy.

rob

0 Kudos

Are you only interested in the data which is being passed back thru EXPORT/IMPORT? If so, then when submitting the program, say TO SAP-SPOOL, this will make it not show the output of the list on the screen.

The only problem with this is it will create a spool. Which really isn't a big deal.

Regards,

Rich Heilman

Former Member
0 Kudos

I was looking at code of SUBMIT(SAPFM06B).

EXPORT ban com TO MEMORY ID 'ZYX'.

IF sy-binpt EQ space. "<--- h91102

IF hucomm EQ 'PRIN' OR sy-batch NE space.

CALL FUNCTION 'GET_PRINT_PARAMETERS'

EXPORTING

mode = 'CURRENT'

no_dialog = 'X'

IMPORTING

out_archive_parameters = arcparams "HW 202820

out_parameters = params

EXCEPTIONS

archive_info_not_found = 1

invalid_print_params = 2

invalid_archive_params = 3

OTHERS = 4.

SUBMIT rm06bl00 TO SAP-SPOOL WITHOUT SPOOL DYNPRO

ARCHIVE PARAMETERS arcparams "HW 202820

SPOOL PARAMETERS params AND RETURN.

ELSE.

SUBMIT rm06bl00 AND RETURN.

ENDIF.

ELSE. "<--- insert

SUBMIT rm06bl00 AND RETURN. "<--- insert

ENDIF. "<--- insert

So if you run your program in batch the output will goto spool, see the SY-BATCH NE SAPCE condition.

Hope this helps.

Cheers

0 Kudos

All I'm really interested in is the EXPORT/IMPORT <u>without modifying standard SAP code</u>. I tried using TO SAP-SPOOL but that didn't work.

SUBMIT <b>rm06ba00</b> TO SAP-SPOOL WITHOUT SPOOL DYNPRO 
      WITH ba_banfn IN r_banfn 
      WITH ba_ekgrp IN r_ekgrp 
      WITH ba_matnr IN r_matnr 
      WITH ba_matkl IN r_matkl 
      WITH s_werks  IN r_werks 
      WITH s_lfdat  IN r_lfdat 
      WITH s_frgdt  IN r_frgdt 
      WITH s_flief  IN r_flief 
      WITH p_afnam  = preq_name 
      WITH p_txz01  = short_text 
      WITH p_zugba  = open 
      WITH p_erblba = closed 
      WITH p_bstba  = open 
      WITH p_freig  = closed 
      WITH p_selgs  = open 
      WITH p_selpo  = open 
      WITH s_kostl  IN r_kostl 
      WITH s_aufnr  IN r_aufnr
    AND RETURN .

I also tried adding in SY-BATCH = 'X' but still didn't work.

However, I did try using JOB_OPEN and JOB_CLOSE. This actually work but I couldn't IMPORT the internal table.

So as you can see I'm still stuck. Please help.

0 Kudos

So in using....



SUBMIT rm06ba00 TO SAP-SPOOL WITHOUT SPOOL

you are still getting the list display of the other submitted program?

I guess this does make sense, because the other program is being submitted a different way.

Regards,

Rich Heilman

0 Kudos

Yes, I still get the list display when using

SUBMIT rm06ba00 TO SAP-SPOOL WITHOUT SPOOL

.

0 Kudos

Did Sanjay's response not help. If you run this in background, it should not show the list.

This standard code will handle it.



FORM SUBMIT USING HUCOMM.
  DATA: PARAMS LIKE PRI_PARAMS.
  DATA: ARCPARAMS LIKE ARC_PARAMS.                           "HW 202820

  EXPORT BAN COM TO MEMORY ID 'ZYX'.
  IF SY-BINPT EQ SPACE.                                   "<--- h91102
     IF HUCOMM EQ 'PRIN' <b>OR SY-BATCH NE SPACE.</b>

       CALL FUNCTION 'GET_PRINT_PARAMETERS'
            EXPORTING
                 MODE                   = 'CURRENT'
                 NO_DIALOG              = 'X'
            IMPORTING
                 OUT_ARCHIVE_PARAMETERS = ARCPARAMS          "HW 202820
                 OUT_PARAMETERS         = PARAMS
            EXCEPTIONS
                 ARCHIVE_INFO_NOT_FOUND = 1
                 INVALID_PRINT_PARAMS   = 2
                 INVALID_ARCHIVE_PARAMS = 3
                 OTHERS                 = 4.

       <b>SUBMIT RM06BL00 TO SAP-SPOOL</b> WITHOUT SPOOL DYNPRO
                     ARCHIVE PARAMETERS ARCPARAMS            "HW 202820
                     SPOOL PARAMETERS PARAMS AND RETURN.
     ELSE.
       SUBMIT RM06BL00 AND RETURN.
     ENDIF.
  ELSE.                                                   "<--- insert
    SUBMIT RM06BL00 AND RETURN.                           "<--- insert
  ENDIF.                                                  "<--- insert
ENDFORM.


So if this is running in the background, it shouldn't show the output list and you also should be able to retrieve your data via IMPORT statement.

Regards,

Rich Heilman

0 Kudos

Rich, my program will be converted into an RFC function module. Does this mean that in doing the submit, it will be run in background mode?

0 Kudos

Not necessarily, you must tell it to do so. I believe that if you call your function module with the extension IN BACKGROUND TASK, then SY-BATCH = 'X'. Hence your problem would be solved.

Regards,

Rich Heilman

0 Kudos

Please make sure you award points to all these guys who have given you some helpful answers.

Regards,

Rich Heilman

0 Kudos

Rich, I created a program that calls my function module IN BACKGROUND TASK for testing purposes. But it's not returning any data at all. If I take out the IN BACKGROUND TASK, I still get the list display but I'm also getting the data that I needed. Am I doing something wrong?

This is the code for calling the function module

 CALL FUNCTION 'ZREQLIST' IN BACKGROUND TASK
       EXPORTING
            s_open       = open
            s_closed     = closed
            s_deleted    = deleted
            s_short_text = short_text
            s_preq_name  = preq_name
       TABLES
            s_banfn    = r_banfn
            s_ekgrp    = r_ekgrp
            s_matnr    = r_matnr
            s_werks    = r_werks
            s_flief    = r_flief
            s_kostl    = r_kostl
            s_aufnr    = r_aufnr
            s_lfdat    = r_lfdat
            s_frgdt    = r_frgdt
            s_matkl    = r_matkl
            lt_eban    = it_eban.

  DESCRIBE TABLE it_eban LINES tabix.

While this is what's inside this function.

 SUBMIT rm06ba00
      WITH ba_banfn IN r_banfn
      WITH ba_ekgrp IN r_ekgrp
      WITH ba_matnr IN r_matnr
      WITH ba_matkl IN r_matkl
      WITH s_werks  IN r_werks
      WITH s_lfdat  IN r_lfdat
      WITH s_frgdt  IN r_frgdt
      WITH s_flief  IN r_flief
      WITH p_afnam  = preq_name
      WITH p_txz01  = short_text
      WITH p_zugba  = open
      WITH p_erblba = closed
      WITH p_bstba  = open
      WITH p_freig  = closed
      WITH p_selgs  = open
      WITH p_selpo  = open
      WITH s_kostl  IN r_kostl
      WITH s_aufnr  IN r_aufnr
      WITH sy-batch = 'X'
    AND RETURN.

  IMPORT ban com FROM MEMORY ID 'ZYX'.

  CLEAR i_lines.
  DESCRIBE TABLE ban LINES i_lines.
  IF i_lines > 0.
    LOOP AT ban.
      MOVE-CORRESPONDING ban TO it_eban.
      APPEND it_eban.
    ENDLOOP.
  ENDIF.

0 Kudos

Ok, so lets think about this logically, you have passed control to a background process, and your program is continuing processing when the other program is not done yet. This is why you are not gettting your data.

Regards,

Rich Heilmn

0 Kudos

How are you going to use this function module. Are you calling it from a program which will be running as a background job? If so, then it will work good if you take out the IN BACKGROUND TASK, if this whole process is running on line, then we have more work to do.

Regards,

Rich Heilman

0 Kudos

A Java program will be triggering this function module. This will be done in real-time so instant result is what I need.

I added in these codes in between the SUBMIT and IMPORT but still nothing. I tried placing it before the submit and after my function module was called but to no avail. What do I do?

  CALL FUNCTION 'START_OF_BACKGROUNDTASK'
       EXPORTING
            startdate = sy-datum
            starttime = sy-uzeit
            nosend    = ' '
       EXCEPTIONS
            OTHERS    = 1.

  IF sy-subrc = 1.
    EXIT.
  ENDIF.

  COMMIT WORK.

0 Kudos

Please help me with this problem..

0 Kudos

You are trying to retrieve records from EBAN, right? Is there anything else that you need from this report. If not, why not just read EBAN directly.

Calling from java will come in via a dialog process, not a background process. I'm still thinking about.

Regards,

Rich Heilman

0 Kudos

JB L, have you come up with a solution yet? Have you tryed accessing EBAN directly? Should be a very simple RFC function module. Or, do you need other data as well? If so, you can probably access that data directly as well. Let us know your progress. Thanks.

Regards,

Rich Heilman

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

If this must run in the foreground, I think your only option would be do copy the first program(RM06BA00) into a "Z" program and modify this statement.

*  PERFORM SUBMIT(SAPFM06B) USING SUCOMM.  "Liste ausgeben
PERFORM SUBMIT(SAPFM06B) USING 'PRIN'.  "Liste ausgeben

Doing so will allow your data to be exported and force the print out to the SAP-SPOOL.

Regards,

Rich Heilman