04-02-2008 7:48 AM
Hello everyone,
my requirement is I have an alv output , when the user is selecting some records ( more than 1 ) , those records are getting posted in FB01 and each time the record is posted, it generates a document number,
Iam capturing all the doc. no. into a table.
but when iam writing loop at that table and write statement , those records are not getting displayed and only the last record posted is getting displayed in STATUS BAR ONLY.
The same is the case with ERROR messages table .
please suggest me how to display the messages on the output screen.( already iam in the output screen , either i have to display in another screen or in the same screen )
willl be rewarded immediately..
04-02-2008 7:56 AM
Hi,
If u are using OOPS ALV then u can create 2 containers. Initially(When u execute the report) display your data In the first container. When user selects some rows and posted then u have all those documents in one internal table. So pass this internal table to second container. This will solve your problem.
If u r using ALV from normal FMs then after initial display when the user selects some rows and post the documents call ur FMs again and display those details.
Hope this will solve ur problem.
Thanks,
Vinod.
04-02-2008 8:00 AM
Hi Sivanagh,
There is no way that the message will get displayed in STATUS BAR if you are using a write statement.
It is not performing your write statement, but showing the last processed FI document to you in status bar. write your reporting statements after all the process is over. your problem would be solved.
for better understanding paste your code extract here. I shall definitely help you out in solving ur problem.
Reward points without fail,
Kiran Kumar Somaroutu - ur X neighbour
04-02-2008 8:01 AM
Hi,
in the following report i m using record updated in first transaction to update another transaction . hope this can help u in finding the solution of ur problem
*Developer : Ashish Paliwal
*Date : 05/02/2008
*Report : BDC on Transaction BGM1 & Transaction ME12
*Transaction Code :
*Description : BDC report on transaction BGM1 to internally generate
master warrnty number and then BDC on ME12 to update
info record by entering generated master warranty no.
in field Vend. mat.group. The input flat file will have
Vendor no & Material No.
*****************************************************************
types Declaration *
*****************************************************************
types: begin of t_tab1 ,
vendor(10),
material(18),
pur_org(4),
wglif(18),
end of t_tab1.
******************************************************************
Data Declaration *
******************************************************************
data : begin of it_tab5 occurs 0,
vendor(10),
material(18),
end of it_tab5.
**DATA : BEGIN OF IT_TAB6 OCCURS 0,
VENDOR(10),
MATERIAL(18),
END OF IT_TAB6.
data: it_tab1 type standard table of t_tab1 with header line.
data: wa_tab1 type t_tab1.
data: wa_tab2 type t_tab1.
data: it_tab3 like bdcdata occurs 0 with header line.
data: it_tab4 like bdcdata occurs 0 with header line.
data: it_tab2 type table of bdcmsgcoll with header line.
data: d_file_name like ibipparms-path,
d_file_name1 type string.
****************************************************************
Start-of-selection *
****************************************************************
start-of-selection.
FM for finding the flat file
call function 'F4_FILENAME'
EXPORTING
PROGRAM_NAME = SYST-CPROG
DYNPRO_NUMBER = SYST-DYNNR
FIELD_NAME = ' '
importing
file_name = d_file_name.
d_file_name1 = d_file_name.
******FM for uploading data from flat file into internal table
call function 'GUI_UPLOAD'
exporting
filename = d_file_name1
filetype = 'ASC'
HAS_FIELD_SEPARATOR = ' '
HEADER_LENGTH = 0
READ_BY_LINE = 'X'
DAT_MODE = ' '
CODEPAGE = ' '
IGNORE_CERR = ABAP_TRUE
REPLACEMENT = '#'
CHECK_BOM = ' '
IMPORTING
FILELENGTH =
HEADER =
tables
data_tab = it_tab5
exceptions
file_open_error = 1
file_read_error = 2
no_batch = 3
gui_refuse_filetransfer = 4
invalid_type = 5
no_authority = 6
unknown_error = 7
bad_data_format = 8
header_not_allowed = 9
separator_not_allowed = 10
header_too_long = 11
unknown_dp_error = 12
access_denied = 13
dp_out_of_memory = 14
disk_full = 15
dp_timeout = 16
others = 17.
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
*************************************************************
End-of-selection *
*************************************************************
end-of-selection.
sort it_tab5 by vendor.
loop at it_tab5.
perform bdc_dynpro using 'SAPLBG00' 0101 .
perform bdc_field using 'BDC_OKCODE' '/00' .
perform bdc_dynpro using 'SAPLBG00' 1000 .
perform bdc_field using 'BDC_OKCODE' '=BUCH' .
perform bdc_field using 'BDC_SUBSCR'
'SAPLBG00 1101KOPF_1000'.
perform bdc_field using 'GBGMK-GAART' '2' .
perform bdc_field using 'GBGMK-GAERB' 'X' .
perform bdc_field using 'BDC_SUBSCR'
'SAPLBG00 1103TAB_SUB_1000'.
perform bdc_field using 'BDC_CURSOR' 'GBGMP-LSTNR(01)' .
perform bdc_field using 'GBGMP-LSTNR(01)' it_tab5-material .
call transaction 'BGM1' using it_tab3 mode 'A' messages into it_tab2.
refresh it_tab3.
ON CHANGE OF IT_TAB5-VENDOR.
EXIT.
ENDON.
****
ENDLOOP.
****
LOOP AT IT_TAB5.
wa_tab1-pur_org = 'ABCP'.
loop at it_tab2.
endloop.
perform bdc_dynpro using 'SAPMM06I' 0100 .
perform bdc_field using 'BDC_CURSOR' 'EINE-EKORG' .
perform bdc_field using 'BDC_OKCODE' '/00' .
perform bdc_field using 'EINA-LIFNR' it_tab5-vendor .
perform bdc_field using 'EINA-MATNR' it_tab5-material .
perform bdc_field using 'EINE-EKORG' wa_tab1-pur_org .
perform bdc_field using 'RM06I-NORMB' 'X' .
perform bdc_dynpro using 'SAPMM06I' 0101 .
perform bdc_field using 'BDC_CURSOR' 'EINA-WGLIF' .
perform bdc_field using 'BDC_OKCODE' '=BU' .
perform bdc_field using 'EINA-WGLIF' it_tab2-msgv1 .
call transaction 'ME12' using it_tab3 mode 'A'.
refresh it_tab3.
refresh it_tab2.
endloop.
&----
*& Form BDC_DYNPRO
&----
Start new screen
----
-->P_FNAM text
-->P_FVAL text
----
form bdc_dynpro using program
dynpro.
clear it_tab3.
it_tab3-program = program.
it_tab3-dynpro = dynpro.
it_tab3-dynbegin = 'X'.
append it_tab3.
endform. " BDC_DYNPRO
&----
*& Form BDC_FIELD
&----
Insert field
----
-->P_FNAM text
-->P_FVAL text
----
form bdc_field using fnam
fval.
clear it_tab3.
it_tab3-fnam = fnam.
it_tab3-fval = fval.
append it_tab3.
endform. " BDC_FIELD
reward if helpful