09-21-2005 10:18 PM
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!
09-21-2005 10:33 PM
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
09-22-2005 12:45 AM
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
09-22-2005 2:59 AM
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
09-22-2005 3:49 PM
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.
09-22-2005 3:52 PM
09-22-2005 3:56 PM
Yes, I still get the list display when using
SUBMIT rm06ba00 TO SAP-SPOOL WITHOUT SPOOL
.
09-22-2005 4:11 PM
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
09-22-2005 4:28 PM
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?
09-22-2005 4:39 PM
09-22-2005 4:41 PM
09-22-2005 7:17 PM
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.
09-22-2005 7:52 PM
09-22-2005 7:56 PM
09-22-2005 8:03 PM
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.
09-23-2005 3:07 PM
09-23-2005 3:15 PM
09-30-2005 3:34 PM
09-22-2005 4:15 PM
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