‎2010 May 26 10:01 PM
Hello Everybody,
I am trying to call transaction F.80 for mass reversal of FI documents by using SUBMIT sentence and its parameters like this:
LOOP AT i_zfi013 INTO wa_zfi013.
PERFORM llena_params USING 'BR_BELNR' 'S' 'I' 'EQ' wa_zfi013-num_doc ''.
range_line-sign = 'I'.
range_line-option = 'EQ'.
range_line-low = wa_zfi013-num_doc.
APPEND range_line TO range_tab.
endloop.
Line: -
SUBMIT sapf080
WITH br_bukrs-low = p_bukrs
WITH SELECTION-TABLE it_params [ same problem with - WITH BR_BELNR IN range_tab]
WITH br_gjahr-low = p_an1
WITH stogrd = '05'
WITH testlauf = ''
AND RETURN.
My problem is that when the report is executed the BR_BELNR only delete one document of the all the inputs in the selection criteria from the loop. if I add the statement [ VIA SELECTION-SCREEN] in the SUBMIT if open the multiple selection criteria in the screen I can check that all the documents are set in it from the ABAP code in the loop from it I just need to push F8 to copy them and run the program processing all the documents normally .
Can some one help me with this? is there a way to execute the transaction BY the SUBMIT with the multiple selection criteria for the Document Number working well?
Thank for you time and help.
‎2010 May 26 10:30 PM
Hi,
May br this non-deleted document from a different year? (or could not to be deleted?)
Best regards,
Leandro Mengue
‎2010 May 26 10:46 PM
No, the documents Exist, the problem is that the data in the Multiple selection screen is not being copied, because if I check it in the SUBMIT manually with the VIA SELECTION-SCREEN statement it ask me to Copy changes? because it detects that the Selections Changed only if I push Yes the documents are processed.
Maybe if some one knows how to call the method that copies the data from the multiple selection screen, I think I could call it from my program to solve my problem.
many thanks.
‎2010 May 26 11:05 PM
Hi,
If you have tested with "VIA SELECTION-SCREEN" and in the selection-screen all documents are ok, the problem is not in your caller program...
Do you know what is the document that dont wotk? If the first in list? The last? If you change the order of documents in the table (ranges) the problem occurs with anhoter document?
Best regards,
Leandro Mengue
‎2010 May 26 11:08 PM
Hi,
Please, run with TESTLAUF = 'X' and see the results.
Best regards,
Leandro Mengue
‎2010 May 26 11:20 PM
Hello, the only one document that is processed by the transactions is the first in the list. all the other documents are not being processed like if they where not in the selection screen.
If I change the testlauf = '' to testlauf = 'X' is the same problem the only way that makes this processing all the documents is entering to the selection criteria for multiple document selections and copy saving changes by pressing F8.
I need a way to do this automatically.
Thanks for your help.
‎2010 May 26 11:58 PM
Hi,
I test it here and works fine. All documents was processed and show in the screen results...
Best regards,
Leandro Mengue
‎2010 May 27 12:09 AM
Hi,
Can you put more code? Like the the data definition of range_tab.
Best regards,
Leandro Mengue
‎2010 May 27 12:18 AM
Thanks for your help, but I still have the same problem, the transaction only process the firs document of the list.
‎2010 May 27 12:24 AM
Hi,
Please, show the definition of range_tab, wa_zfi013 and zfi013 (table?).
Best regards,
Leandro Mengue
‎2010 May 27 12:39 AM
This is my code:
TYPES: BEGIN OF T_ZFI013,
BUKRS TYPE BUKRS,
GJAHR TYPE GJAHR,
MONAT TYPE MONAT,
ANLN1 TYPE ANLN1,
ANLN2 TYPE ANLN2,
NUM_DOC TYPE BELNR_D,
DATE TYPE DATUM,
TIME TYPE UZEIT,
USER TYPE SYUNAME,
END OF T_ZFI013.
DATA: I_ZFI013 TYPE STANDARD TABLE OF T_ZFI013,
WA_ZFI013 TYPE T_ZFI013,
DATA: br_belnr TYPE BELNR_D,
rspar_tab TYPE TABLE OF rsparams,
rspar_line LIKE LINE OF rspar_tab,
range_tab LIKE RANGE OF br_belnr,
range_line LIKE LINE OF range_tab."range_tab.
**********************************************************************
LOOP AT i_zfi013 INTO wa_zfi013.
range_line-sign = 'I'.
range_line-option = 'EQ'.
range_line-low = wa_zfi013-num_doc.
APPEND range_line TO range_tab.
ENDLOOP.
SUBMIT sapf080
WITH br_bukrs-low = p_bukrs
WITH br_belnr IN range_tab
WITH br_gjahr-low = p_an1
WITH stogrd = '05'
WITH testlauf = ''.
This is the RANGE_TAB table before submit:
1 I EQ 1001xxxxxx
2 I EQ 1002xxxxxx
3 I EQ 1003xxxxxx
4 I EQ 1004xxxxxx
5 I EQ 1005xxxxxx
6 I EQ 1006xxxxxx
7 I EQ 1007xxxxxx
8 I EQ 1008xxxxxx
I think this wont work for some reason so I will start to do this by a BDC.
Many thanks for your help.
‎2010 May 27 3:00 AM
Hi,
Tomorrow I will try this code in my office.
Best regards,
Leandro Mengue
‎2010 May 27 5:21 PM
Thanks for your Help,
I tried with this FM 'SUBMIT_REPORT''
But still I have the same problem.
-
FORM
wa_params-selname = fieldn.
wa_params-kind = kind.
wa_params-sign = sign.
wa_params-option = opt.
wa_params-low = p_low.
IF p_high <> ''.
wa_params-high = p_high.
ENDIF.
APPEND wa_params TO it_params.
CLEAR wa_params.
ENDFORM
-
p_trdir-name = 'SAPF080'.
CALL FUNCTION 'SUBMIT_REPORT'
EXPORTING
RDIR = TRDIR
report = p_trdir-name
RET_VIA_LEAVE = 'X'
VARIANT = 'ZTEST'
VARIPROG = ' '
SKIP_SELSCREEN = 'X'
EXPRESSIONS =
IMPORTING
VARIANT =
TABLES
selection_table = it_params
EXCEPTIONS
just_via_variant = 1
no_submit_auth = 2
OTHERS = 3.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
-
Also I I ran it with SKIP_SELSCREEN = 'X'
and save variant and if I ran the report from SE38 with the saved variant is the same problem, is like if in the Multiple selection were empty although you see the input data there.
‎2010 May 27 8:54 PM
Hi,
The problem is linked with the logical database that sapf080 is using...
Best regards,
Leandro Mengue
‎2010 May 27 9:15 PM
Many thanks for your help and Time,
Finally I decide to do this by a BDC and is working well in this way.
‎2010 May 31 4:53 PM
Hello,
After making some test with the BDC I realized that if i ran it in mode N the problem was the same of the submit, so I diced to make another test with the submit, fortunately I don't know why, but the submit is working well now.