Problem While Saving the editable ALV GRID
Dear Experts,
I have a scenario in which i am display the ALV(using class) with some data in the custom container of module pool screen in the non-editable mode.Also i have save and edit buttons.If i click the edit button i have written the code to edit the some columns in the ALV grid, it is working fine.After editing it,when i click the save button then ALV has to refreshed with edited data and then it should go to non editable mode but it is not working.I have written the code for changing the editable ALv to non editable mode as follows :
call method c_alvgd->set_ready_for_input
exporting
i_ready_for_input = 0.
*****Row and column of the alv are refreshed after changing values
stable-row = 'X'.
stable-col = 'X'.
*REfreshed ALV display with the changed values
*This ALV is non editable and contains new values
call method c_alvgd->refresh_table_display
exporting
is_stable = stable
exceptions
finished = 1
others = 2.
if sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
Could you Suggest me solution for this issue ?
Thanks & Regards,
R.Dhineshraj.
Dhinesh,
I suppose that you are able to get your changes values on screen but not able to get your field in DISPLAY mode from editable mode, let me know if this is not your problem.
When you press SAVE, after the PAI, again PBO will run and hence the editable code for that field will overwrite which will keep it editable.
So, do something like this.
data: gv_edit value 'X'..... "global variable in TOP include
PBO....
loop at ...
if gv_edit = 'X'.
CALL METHOD lo_alv->set_ready_for_input
EXPORTING
i_ready_for_input = 1.
else.
CALL METHOD lo_alv->set_ready_for_input
EXPORTING
i_ready_for_input = 0.
endif.
endloop.
PAI.
when 'SAVE'.
gv_edit = space.
When 'EDIT'.
gv_edit = 'X'.
Regards,
Diwakar
Similar Messages
-
Problem While saving the Invoice
Dear Experts,
I am facing the Problem while Saving the Invoice, In invoice, We assigne the Output as RD00 and Medium as 6 (EDI).
When we are saving the Invoice, it getting as ' Updated Terminated'. When i found where the Error is coming in SM13, it showing in as Function Module "RV_MESSAGE_UPDATE' & Error Details is 'EAN11 not found for Material'.
But in Invoice whatever we enter the Material number, we maintain the EAN11 code. This EAN11 code is seen in MARM & VBRP Table. Unable to find the what the exact error is.
please help me to sort this issue, Its business complicated.
Thanks in Advance,
SriniHi Asik,
Thanks for your valuable Message.... I run as you suggested, but the dispatch time i kept as 1 or 2. because the program RSNAST00 is picking the values only for 1 or 2. so i run manually,, as of now the issue is, in the invoice number, for one material number, the Billed quantity is zero, so the UOM is getting as initial. From those vaues we are picking the EAN11 from maram table.
So, i modify that and run the EDI manually. As of now its working...
Thanks for your reply,,,
Regards,
Srini -
Original picture changed while saving the edited one
Hi,
I am an absolute beginner using Camera Raw.
I just edit a picture in Camera Raw 5.7. When I was finished I saved the edited picture using a new name. Unfortunatly the original picture has also changed. So now I have two identical edited pictures with different names but the original picture is gone. How can I keep the original?
Regards, NicoleThe original image is still there...it's just had processing parameters added to the raw file. If you really don't want them you can either go into Bridge, Edit, Develop Settings and hit clear. But if you do that you will loose all the work you put into making the adjustments...you might be better off going back into Camera Raw and create a snapshot of the settings them you can reset the image to it's default settings...
-
Problem while setting PF_status in ALV Grid Display
Hi,
i have a final internal table with first field as a check box. I have delete button on application tool-bar, with usercommand and pf status defined for it.
Once the output is displayed i should have the option of checking the line (check box) and delete then records from the list.
problem here is once i check the box and click on delete button is not getting deleted. but instead if i check the box and double click on the line(ie f2 fuctionality) and then click on refresh, then the records are getting deleted.
i have not provided and pf status for f2 functionality, by default its getting activated before the delete fuctionality is called.
i have attached my code below.
DATA : fk_events TYPE slis_t_event,
f_user_command TYPE slis_formname VALUE 'USER_COMMAND',
f_status TYPE slis_formname VALUE 'STANDARD_SP01',
fieldnam(10) TYPE c.
DATA: gs_layout TYPE slis_layout_alv.
DATA: ls_event TYPE slis_alv_event.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
i_list_type = 0
IMPORTING
et_events = fk_events.
READ TABLE fk_events INTO ls_event WITH KEY name = slis_ev_user_command
IF sy-subrc = 0.
MOVE f_user_command TO ls_event-form.
MODIFY fk_events FROM ls_event TRANSPORTING form WHERE name =
ls_event-name.
ENDIF.
READ TABLE fk_events INTO ls_event WITH KEY name =
slis_ev_pf_status_set
IF sy-subrc = 0.
MOVE f_status TO ls_event-form.
MODIFY fk_events FROM ls_event TRANSPORTING form WHERE name =
ls_event-name.
ENDIF.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = 'ZWR_SECOND_TO_CREATION1'
i_callback_pf_status_set = f_status
i_callback_user_command = f_user_command
it_fieldcat = gt_fieldcat[]
it_events = fk_events[]
TABLES
t_outtab = gt_final[]
EXCEPTIONS
program_error = 1
OTHERS = 2.
FORM user_command USING r_comm TYPE sy-ucomm
rs_selfield TYPE slis_selfield.
fieldnam = rs_selfield-fieldname.
CASE r_comm.
WHEN 'DELETE''.
LOOP AT gt_final INTO gk_final.
IF gk_final-del_sat = 'X'.
DELETE gt_final WHERE vbeln = gk_final-vbeln.
ENDIF.
rs_selfield-refresh = 'X'.
ENDLOOP.
WHEN OTHERS.
EXIT.
ENDCASE.
FORM standard_sp01 USING extab TYPE slis_t_extab.
SET PF-STATUS 'RAM' EXCLUDING extab. " For PF-Status
ENDFORM. "STANDARD_SP01
i wud be very thankful if someone cud help me
thanx
ramHi,
i have a final internal table with first field as a check box. I have delete button on application tool-bar, with usercommand and pf status defined for it.
Once the output is displayed i should have the option of checking the line (check box) and delete then records from the list.
problem here is once i check the box and click on delete button is not getting deleted. but instead if i check the box and double click on the line(ie f2 fuctionality) and then click on refresh, then the records are getting deleted.
i have not provided and pf status for f2 functionality, by default its getting activated before the delete fuctionality is called.
i have attached my code below.
DATA : fk_events TYPE slis_t_event,
f_user_command TYPE slis_formname VALUE 'USER_COMMAND',
f_status TYPE slis_formname VALUE 'STANDARD_SP01',
fieldnam(10) TYPE c.
DATA: gs_layout TYPE slis_layout_alv.
DATA: ls_event TYPE slis_alv_event.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
i_list_type = 0
IMPORTING
et_events = fk_events.
READ TABLE fk_events INTO ls_event WITH KEY name = slis_ev_user_command
IF sy-subrc = 0.
MOVE f_user_command TO ls_event-form.
MODIFY fk_events FROM ls_event TRANSPORTING form WHERE name =
ls_event-name.
ENDIF.
READ TABLE fk_events INTO ls_event WITH KEY name =
slis_ev_pf_status_set
IF sy-subrc = 0.
MOVE f_status TO ls_event-form.
MODIFY fk_events FROM ls_event TRANSPORTING form WHERE name =
ls_event-name.
ENDIF.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = 'ZWR_SECOND_TO_CREATION1'
i_callback_pf_status_set = f_status
i_callback_user_command = f_user_command
it_fieldcat = gt_fieldcat[]
it_events = fk_events[]
TABLES
t_outtab = gt_final[]
EXCEPTIONS
program_error = 1
OTHERS = 2.
FORM user_command USING r_comm TYPE sy-ucomm
rs_selfield TYPE slis_selfield.
fieldnam = rs_selfield-fieldname.
CASE r_comm.
WHEN 'DELETE''.
LOOP AT gt_final INTO gk_final.
IF gk_final-del_sat = 'X'.
DELETE gt_final WHERE vbeln = gk_final-vbeln.
ENDIF.
rs_selfield-refresh = 'X'.
ENDLOOP.
WHEN OTHERS.
EXIT.
ENDCASE.
FORM standard_sp01 USING extab TYPE slis_t_extab.
SET PF-STATUS 'RAM' EXCLUDING extab. " For PF-Status
ENDFORM. "STANDARD_SP01
i wud be very thankful if someone cud help me
thanx
ram -
Problem while saving the BEx qeueries
Hi,
I am facing a strange problem.
I am trying to copy the old query to a new query. Now when i just change/try to copy by using save as function in query designer the following problem occurs
1. An unexpected object variable or with block variable not setu2019 error occurred in wdrblog error(s) are logged.
I am using BEx 3.5 patch 11.
Note: I checked the relevant error message in Service marketplace but they are asking us to go thorugh the OSS note 571831,575434. But in these mentioned notes the patch level & Version are lower than what we have.
Waht might the problem. any clues would be great & appreciated
ThanksHello Venkatesh,
I didn't come across this type of problem before, just try to copy the query by using t-code 'RSZC'. Check the query whether everything is correct.
Let me know if you need more information to copy the query.
Thanks,
Umashankar -
Problem while saving the query
I have created transport request from solman, and when I try to save the query under the the request it is asking whether to create a new task under a different specific user, if I cancel it the query is not getting saved, please help me.
thanksHey Sudeer,
This happens becoz the Query that u are changing is already locked by another transport request which is owned by diffrent user..
Ask the relevant user to release the corresponding request, so that u dont get the prompt again....
To avoid it, just create a new Query( totally new query ) and then assign your transport request to it..
Reward points for usefull answer...
Regards,
Anand Rangarajan -
Problems while saving the tax values in a Draft Document to AP Invoice
Hi All
I have an interface .net where I use a DIAPI to enter values in B1 2007 B (8.60.039) PL 15.
I have the following cases:
First case
- I create a document type oPurchaseInvoices, where I set the tax values for IRPF, INSS, ISSQN (Brazil).
When i execute the code that inserts this A/P Invoice in SAP, it works perfectly, including by setting the values of the taxes correctly.
Second case
- I create a document type oDrafts, and say that this draft is the type oPurchaseInvoices.
After that I follow the same steps to launch a note entry, laying the tax values(IRPF, INSS, ISSQN) and everything else.
When i execute the code that inserts this values in the draft, the tax values are not entered and that everything else works perfectly.
You can tell me whether the taxes really are not inserted when I issue a draft or I'm leaving to score some parameter.
I am in the look of your response
Regards
Luis FelipeHi Gordon.
You can see below the part of the code to add the Draft Document.
oAPInvoice = oCompany.SapCommand.GetBusinessObject(BoObjectTypes.oDrafts)
oAPInvoice.DocObjectCode = BoObjectTypes.oPurchaseInvoices
With oAPInvoice
.Lines.TaxLiable = BoYesNoEnum.tYES
.Lines.ItemCode = Itemcode
.Lines.Quantity = Quantity
.Lines.UnitPrice = Unitprice
.Lines.TaxCode = Taxcode
.Lines.WTLiable = BoYesNoEnum.tNO
.Lines.Usage = "Consumo"
If oDTO.IRRF > 0 Or oDTO.INSS > 0 Or oDTO.ISSQN > 0 Then
If oDTO.WtLiable = "Y" Then .Lines.WTLiable = BoYesNoEnum.tYES
Add tax values
For i As Int16 = 1 To 3
vlrImposto = 0
addTax = False
If IRRF > 0 And Not addIR Then
codImposto = CodeIRRF (tax code)
vlrImposto = IRRF (tax value)
addIR = True
addTax = True
ElseIf INSS > 0 And Not addINSS Then
codImposto = "F501" (tax code)
vlrImposto = INSS (tax value)
addINSS = True
addTax = True
ElseIf ISSQN > 0 And Not addISSQN Then
codImposto = CodeISSQN (tax code)
vlrImposto = ISSQN (tax value)
addISSQN = True
addTax = True
End If
If addTax Then
(If include more one tax then add line)
If i > 1 And vlrImposto > 0 Then .Lines.WithholdingTaxLines.Add()
.Lines.WithholdingTaxLines.WTCode = codImposto (tax code)
.Lines.WithholdingTaxLines.TaxableAmount = Unitprice (base value calculation)
.Lines.WithholdingTaxLines.WTAmount = vlrImposto (tax value)
End If
Next
End If
.CardCode = Cardcode
.CardName = Cardname
.HandWritten = BoYesNoEnum.tNO
.DocDueDate = DueDate
.DocDate = DocDate
.TaxDate = TaxDate
.SequenceCode = -2 '-1=Manual -2=External
.SeriesString = "RCB"
.SequenceModel = 37
lRetCode = .Add()
End With
Regards
Luis Felipe -
Warning massage while saving the asset master record
Hi all,
I have a problem while saving the asset master record.My client manages the group asset in the depreciation area 15 for tax reporting.What I have done in the configuration that, I have created a separate asset class for group asset and marked this asset for entirely consisting of group assets.Then I have createdall the grpup assets in this marked class.For example, supppose I have created one group asset class 50000 and I have created all the group assets in this class.Then I assign the gr.asset no. in the master record of the normal assets and while saving the master record I am getting the warning massage as the account determination is different than the asset.It may't be possible to reconcile them from the FI-AA.But if I am creating the group assets in the class of the normal assets such type of error massage doesn't appear.Also while retiring the normal assets the asseet is not being deactivated automatically and instead a warning massage is coming the asset is still having value in the depreciation area 15 and can't be deactivated.Can any body suggest where I have gone wrong in the configuration?
Debabrata DasUpdate delays sometimes mean that there is a queue waiting at the UPD task. Go to SM51 and check to make sure that there are no other tasks waiting to be processed. Check with you Basis group - they might be able to run some diagnostics on the update task.
-
Mark fields (columns) in editable ALV Grid as mandatory
Hi,
could you please help me to set up a column in an editable alv grid as mandatory? I had a look in several references and also did not find anything in the fieldcatalog structure.
Best regards,
FabianHello Fabian
Here is some coding to explain what I meant.
*& Report ZUS_SDN_ALV_ERROR_LOG
REPORT zus_sdn_alv_error_log.
DATA:
er_data_changed TYPE REF TO cl_alv_changed_data_protocol.
START-OF-SELECTION.
* Dynpro is empty (contains no elements)
CALL SCREEN '0100'.
END-OF-SELECTION.
*& Module PBO_0100 OUTPUT
* text
MODULE pbo_0100 OUTPUT.
* Event DATA_CHANGED was fired due to changes in the editable ALV grid
IF ( er_data_changed IS BOUND ).
* User did not change any values
ELSE.
CREATE OBJECT er_data_changed
* EXPORTING
* I_CONTAINER =
* I_CALLING_ALV = <your ALV grid instance>
ENDIF.
* That is how your code probably looks like
* LOOP AT gt_outtab INTO gs_outtab.
* IF ( gs_outtab-obligatory IS INITIAL ).
* CALL METHOD go_alvlog->add_protocol_entry
* EXPORTING
* i_msgid = '00'
* i_msgty = 'E'
* i_msgno = '398'
* I_MSGV1 = 'Field OBLIGATORY must not be empty'
** I_MSGV2 =
** I_MSGV3 =
** I_MSGV4 =
* i_fieldname = 'OBLIGATORY'
** I_ROW_ID =
* I_TABIX = syst-tabix
* ENDIF.
* ENDLOOP.
* Generate a protocol for testing purposes
DO 5 TIMES.
CALL METHOD er_data_changed->add_protocol_entry
EXPORTING
i_msgid = '00'
i_msgty = 'E'
i_msgno = '398'
i_msgv1 = 'Field OBLIGATORY must not be empty'
* I_MSGV2 =
* I_MSGV3 =
* I_MSGV4 =
i_fieldname = 'OBLIGATORY'
i_row_id = syst-index
i_tabix = syst-index
ENDDO.
CALL METHOD er_data_changed->display_protocol
* EXPORTING
* I_CONTAINER =
ENDMODULE. " PBO_0100 OUTPUT
Please note that this report dumps as soon as you close the log popup. However, this will not happen within your event handler method.
Regards
Uwe -
How to Transfer Data from editable ALV grid control to internal table?
Hi,
Can anyone give me a simple example by which I can transfer data from editable alv grid control back to the internal table. The ALV has been created by OO approach.
I would appreciate if the solution is provided without handling any events.
Regards,
AuroHello Auro
You simply need to call method <b>go_grid->check_changed_data</b> at PAI of the dynpro displaying the ALV grid. If data have been changed on the editable ALV grid then this method will raise event DATA_CHANGED. If you do not want or need to handle this event (e.g. for validating the edited values) then you do not define any event handler method.
Regards
Uwe -
Facing a Problem while downloading the data from ALV Grid to Excel Sheet
Hi Friends,
Iam facing a problem while downloading the data from ALV Grid to excel sheet. This is working fine in Development server , when comes to Quality and Production servers I have this trouble.
I have nearly 11 fields in ALV Grid and out of which one is PO number of length 10 , all the ten numbers are visible in the excel sheet if we download it from development server but when we download it from Quality or Production it is showing only 9 numbers.
Can any one help me out in this case.hi...
if this problems happens dont display the same internal as u finally got.
just create new internal table without calling any standard data elements and domains... but the new internal table s similar like ur final internal table and move all the values to new int table.
for eg.
ur final internal int table for disp,
data : begin of itab occur 0,
matnr like mara-matnr,
end of itab.
create new like this,
data : begin of itab occur 0,
matnr(12) type N,
end of itab. -
Urgent : Problem with Editable ALV Grid for Quantity and Currency Fields
Hi All,
I am using Editable ALV Grid display and have quantity and value as editable fields in the display.
When user changes these values these values are not changing properly .
For the quantity field the domain is MENG13 with 3 deciamal places and here if we enter 500 it takes it as 0.500 .
The same problem is for the currency field. Here the Domain is WERT7 with 3 decimal places.
Here also it takes last 2 digits after decimal places by default.
Please advice how to get proper values in this case from ALV editable fields.
Thanks and Regards
Harshad
Edited by: Harshad Rahirkar on Dec 25, 2007 7:39 AMfor all the currency field , it will display like that only.
u have to manipulate uin program before displaying.
if they are giving 500, in program multiply with 100 and move it to table.
when u are getting from table, divinde and display.
this is what I am doing.
Reward if helpfull. -
Can't create a new illustration. Problems occurred while saving the print file.
I can't open a new Illustrator file. It sends me this error: Can't create a new illustration. Problems occurred while saving the print file. ID:-1
I opened a previous document created in CC, but it will not allow me to copy and paste items from one doc to another.
I have rebooted with no avail.
System:
Adobe Creative Cloud CC
Mac Book Pro 2012
2.6 GHz Intel Core i7
8 GB 1600 MHz DDR3Is a printer connected? Is it turned ON? Is the driver up to date?
Illustrator checks this every time and also writes information on the printer into the file. -
Problem in handling double click in the second alv grid control
Hi all,
I have a screen. In the screen , I have 2 custom container and each custom container has 1 alv grid control.
I need to handle double click event for both of alv grid controls in my screen.
I defined 2 local event handler class for each alv grid and defined 2 handle_double_click event.
In the first Alv grid double click works fine , everything is ok, world is peaceful.
But in the second alvgrid, the row parameters (E_ROW, E_COLUMN, ES_ROW_NO) comes initial so i cannot handle it.
All i need is to call a different transaction (displaying the equipment-IE03) when user double-click on a field in the second alv grid control. I tried to use hotspot_click event too but it does'nt give the row id either.
I read some posts in the forms ([Double click event of alv grid control|Double click event of alv grid control]).
I tried everything but nothing works.
Please help. Your answers will be appreciated.Hello Eagle
I am not sure where the problem lies in your case but sample report ZUS_SDN_THREE_ALV_GRIDS_01 shows that you can always find out the current cell after the double-click event (in any case you have the current cell already as IMPORTING parameters of the event):
*& Report ZUS_SDN_THREE_ALV_GRIDS_01
*& Flow logic of screen '0100' (no screen elements, ok-code => GD_OKCODE):
** PROCESS BEFORE OUTPUT.
** MODULE STATUS_0100.
** PROCESS AFTER INPUT.
** MODULE USER_COMMAND_0100.
*& Thread: problem in handling double click in the second alv grid control
*& <a class="jive_macro jive_macro_thread" href="" __jive_macro_name="thread" modifiedtitle="true" __default_attr="1172052"></a>
REPORT zus_sdn_three_alv_grids_01.
DATA:
gd_okcode TYPE ui_func,
gd_repid TYPE syst-repid,
go_docking TYPE REF TO cl_gui_docking_container,
go_splitter TYPE REF TO cl_gui_splitter_container,
go_splitter_2 TYPE REF TO cl_gui_splitter_container,
go_cell_top TYPE REF TO cl_gui_container,
go_cell_bottom TYPE REF TO cl_gui_container,
go_cell_left TYPE REF TO cl_gui_container,
go_cell_right TYPE REF TO cl_gui_container,
go_grid1 TYPE REF TO cl_gui_alv_grid,
go_grid2 TYPE REF TO cl_gui_alv_grid,
go_grid3 TYPE REF TO cl_gui_alv_grid.
DATA:
gt_outtab TYPE STANDARD TABLE OF vbak,
gt_outtab_2 TYPE STANDARD TABLE OF vbap,
gt_outtab_3 TYPE STANDARD TABLE OF vbep.
**PARAMETERS:
** p_bukrs TYPE bukrs DEFAULT '1000'.
* CLASS lcl_eventhandler DEFINITION
CLASS lcl_eventhandler DEFINITION.
PUBLIC SECTION.
CLASS-DATA:
ms_row TYPE lvc_s_row,
ms_col TYPE lvc_s_col.
CLASS-METHODS:
handle_double_click FOR EVENT double_click OF cl_gui_alv_grid
IMPORTING
e_row
e_column
es_row_no
sender.
ENDCLASS. "lcl_eventhandler DEFINITION
* CLASS lcl_eventhandler IMPLEMENTATION
CLASS lcl_eventhandler IMPLEMENTATION.
METHOD handle_double_click.
* define local data
DATA:
ls_outtab TYPE vbak,
ls_outtab_2 TYPE vbap,
ls_outtab_3 TYPE vbep.
" Initialize class data
CLEAR: ms_row,
ms_col.
CASE sender.
WHEN go_grid1.
ms_row = e_row.
ms_col = e_column.
* Triggers PAI of the dynpro with the specified ok-code
CALL METHOD cl_gui_cfw=>set_new_ok_code
EXPORTING
new_code = 'GET_ITEMS'
* IMPORTING
* rc =
WHEN go_grid2.
ms_row = e_row.
ms_col = e_column.
* Triggers PAI of the dynpro with the specified ok-code
CALL METHOD cl_gui_cfw=>set_new_ok_code
EXPORTING
new_code = 'GET_SCHEDULE_LINES'
* IMPORTING
* rc =
WHEN go_grid3.
** READ TABLE gt_vbap INTO ls_vbap INDEX e_row-index.
** CHECK ( ls_vbap-matnr IS NOT INITIAL ).
** SET PARAMETER ID 'MAT' FIELD ls_vbap-matnr.
** CALL TRANSACTION 'MM02' AND SKIP FIRST SCREEN.
WHEN OTHERS.
RETURN.
ENDCASE.
ENDMETHOD. "handle_double_click
ENDCLASS. "lcl_eventhandler IMPLEMENTATION
START-OF-SELECTION.
SELECT * FROM vbak INTO TABLE gt_outtab UP TO 100 ROWS.
PERFORM init_controls.
* Display data
CALL METHOD go_grid1->set_table_for_first_display
EXPORTING
i_structure_name = 'VBAK'
CHANGING
it_outtab = gt_outtab
EXCEPTIONS
OTHERS = 4.
IF sy-subrc NE 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
REFRESH: gt_outtab_2.
CALL METHOD go_grid2->set_table_for_first_display
EXPORTING
i_structure_name = 'VBAP'
CHANGING
it_outtab = gt_outtab_2 " empty !!!
EXCEPTIONS
OTHERS = 4.
IF sy-subrc NE 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
REFRESH: gt_outtab_3.
CALL METHOD go_grid3->set_table_for_first_display
EXPORTING
i_structure_name = 'VBEP'
CHANGING
it_outtab = gt_outtab_3 " empty !!!
EXCEPTIONS
OTHERS = 4.
IF sy-subrc NE 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
* Link the docking container to the target dynpro
gd_repid = syst-repid.
CALL METHOD go_docking->link
EXPORTING
repid = gd_repid
dynnr = '0100'
* CONTAINER =
EXCEPTIONS
OTHERS = 4.
IF sy-subrc NE 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
* NOTE: dynpro does not contain any elements
CALL SCREEN '0100'.
* Flow logic of dynpro:
*PROCESS BEFORE OUTPUT.
* MODULE STATUS_0100.
*PROCESS AFTER INPUT.
* MODULE USER_COMMAND_0100.
END-OF-SELECTION.
*& Module STATUS_0100 OUTPUT
* text
MODULE status_0100 OUTPUT.
SET PF-STATUS 'STATUS_0100'. " contains push button "ORDERS"
* SET TITLEBAR 'xxx'.
* Refresh display of detail ALV list
CALL METHOD go_grid2->refresh_table_display
* EXPORTING
* IS_STABLE =
* I_SOFT_REFRESH =
EXCEPTIONS
OTHERS = 2.
IF sy-subrc NE 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
* Refresh display of detail ALV list
CALL METHOD go_grid3->refresh_table_display
* EXPORTING
* IS_STABLE =
* I_SOFT_REFRESH =
EXCEPTIONS
OTHERS = 2.
IF sy-subrc NE 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDMODULE. " STATUS_0100 OUTPUT
*& Module USER_COMMAND_0100 INPUT
* text
MODULE user_command_0100 INPUT.
CASE gd_okcode.
WHEN 'BACK' OR
'END' OR
'CANC'.
SET SCREEN 0. LEAVE SCREEN.
" Double-click on first or second ALV grid
WHEN 'GET_ITEMS' OR
'GET_SCHEDULE_LINES'.
PERFORM get_details.
WHEN OTHERS.
ENDCASE.
CLEAR: gd_okcode.
ENDMODULE. " USER_COMMAND_0100 INPUT
*& Form INIT_CONTROLS
* text
* --> p1 text
* <-- p2 text
FORM init_controls .
* Create docking container
CREATE OBJECT go_docking
EXPORTING
parent = cl_gui_container=>screen0
ratio = 90
EXCEPTIONS
OTHERS = 6.
IF sy-subrc NE 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
* Create splitter container
CREATE OBJECT go_splitter
EXPORTING
parent = go_docking
rows = 1
columns = 2
* NO_AUTODEF_PROGID_DYNNR =
* NAME =
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
OTHERS = 3.
IF sy-subrc NE 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
* Get cell container
CALL METHOD go_splitter->get_container
EXPORTING
row = 1
column = 1
RECEIVING
container = go_cell_left.
CALL METHOD go_splitter->get_container
EXPORTING
row = 1
column = 2
RECEIVING
container = go_cell_right.
* Create 2nd splitter container
CREATE OBJECT go_splitter_2
EXPORTING
parent = go_cell_left
rows = 2
columns = 1
* NO_AUTODEF_PROGID_DYNNR =
* NAME =
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
OTHERS = 3.
IF sy-subrc NE 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
* Get cell container
CALL METHOD go_splitter_2->get_container
EXPORTING
row = 1
column = 1
RECEIVING
container = go_cell_top.
CALL METHOD go_splitter_2->get_container
EXPORTING
row = 2
column = 1
RECEIVING
container = go_cell_bottom.
* Create ALV grids
CREATE OBJECT go_grid1
EXPORTING
i_parent = go_cell_top
EXCEPTIONS
OTHERS = 5.
IF sy-subrc NE 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CREATE OBJECT go_grid2
EXPORTING
i_parent = go_cell_bottom
EXCEPTIONS
OTHERS = 5.
IF sy-subrc NE 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CREATE OBJECT go_grid3
EXPORTING
i_parent = go_cell_right
EXCEPTIONS
OTHERS = 5.
IF sy-subrc NE 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
* Set event handler
SET HANDLER: lcl_eventhandler=>handle_double_click FOR go_grid1.
SET HANDLER: lcl_eventhandler=>handle_double_click FOR go_grid2.
SET HANDLER: lcl_eventhandler=>handle_double_click FOR go_grid3.
ENDFORM. " INIT_CONTROLS
*& Form GET_DETAILS
* text
* --> p1 text
* <-- p2 text
FORM get_details .
* define local data
DATA: ls_row TYPE lvc_s_row,
ls_col TYPE lvc_s_col.
data: ls_outtab type vbak,
ls_outtab_2 type vbap,
ls_outtab_3 type vbep.
BREAK-POINT.
CASE gd_okcode.
WHEN 'GET_ITEMS'.
CALL METHOD go_grid1->get_current_cell
IMPORTING
* e_row =
* e_value =
* e_col =
es_row_id = ls_row
es_col_id = ls_col
* es_row_no =
read TABLE gt_outtab into ls_outtab index ls_row-index.
refresh: gt_outtab_2,
gt_outtab_3.
SELECT * FROM vbap into TABLE gt_outtab_2
WHERE vbeln = ls_outtab-vbeln.
WHEN 'GET_SCHEDULE_LINES'.
CALL METHOD go_grid2->get_current_cell
IMPORTING
* e_row =
* e_value =
* e_col =
es_row_id = ls_row
es_col_id = ls_col
* es_row_no =
READ TABLE gt_outtab_2 into ls_outtab_2 index ls_row-index.
refresh: gt_outtab_3.
SELECT * FROM vbep into TABLE gt_outtab_3
WHERE vbeln = ls_outtab_2-vbeln
AND posnr = ls_outtab_2-posnr.
WHEN OTHERS.
RETURN.
ENDCASE.
IF ( lcl_eventhandler=>ms_row = ls_row AND
lcl_eventhandler=>ms_col = ls_col ).
MESSAGE 'Current cell identical' TYPE 'I'.
ELSE.
MESSAGE 'Current cell NOT identical' TYPE 'I'.
ENDIF.
ENDFORM. " GET_DETAILS
Regards
Uwe -
Determining Duplicate Entries in Editable ALV Grid
Hopefully this question is not as obvious as it may seem at first. Thanks for any input or ideas...read carefully, it is not just a simple duplicate check with which I'm having a problem.
I have an editable ALV grid and I need to ensure that the user doesn't try to enter the same material number twice. I used the program BCALV_EDIT_03 and 04 as a model. I can tell if in my session a user is trying to put in the material number twice. Not a problem. I can also tell if the user is trying to add a material to the ones already on the grid that is a duplicate. That is not a problem either. Here is the catch...and I'd like to point out that BCALV_EDIT_04 has the same problem.
The user enters line 10 with material 0245 and line 20 with 0345. There is no duplicate. Then they say, 'Oooops, I got them backward' and then move 0345 to line 10 and 0245 to line 20. When you hit enter, the change handler says that line 10 and 20 were changed and the field MATNR was changed. It then compares the new fields to what is already in the grid...low and behold the grid already has these two entries and the protocol adds the error for both lines.
I will add the code here, but it is pretty much exactly as in BCALV_EDIT_04. If you want to see the error in that program execute it, put in two new lines with the same airline and two different dates and hit save. Everything is fine. Then swap the dates and hit Save again...it will say these are duplicates, which they are not...this program is not saving to the database. The only difference between mine and bcalv_edit_04 is that mine uses an 'ENTER' event and not a 'SAVE'.
I'm looking for good ideas on how to compare the two...the mt_good_cells (session active) and the grid itself to know when a user has 'moved' data. The current workaround is for the user to copy the line and then reapply it...but that seems a bit glitchy.
Thanks in advance, I appreciate any sage advice. : )
METHOD check_double_entries.
DATA: lt_good_cells TYPE lvc_t_modi,
ls_good TYPE lvc_s_modi,
l_matnr TYPE matnr,
l_del_row TYPE lvc_s_moce,
ls_rosi LIKE LINE OF i_rosi,
l_reentered TYPE c.
LOOP AT pr_data_changed->mt_good_cells INTO ls_good.
CASE ls_good-fieldname.
WHEN 'MATNR'.
CALL METHOD pr_data_changed->get_cell_value
EXPORTING
i_row_id = ls_good-row_id
i_fieldname = ls_good-fieldname
IMPORTING
e_value = l_matnr.
READ TABLE lt_good_cells WITH KEY
value = l_matnr
TRANSPORTING NO FIELDS.
IF sy-subrc = 0.
CALL METHOD pr_data_changed->add_protocol_entry
EXPORTING
i_msgid = '0K'
i_msgno = '000'
i_msgty = 'E'
i_msgv1 = text-m01
i_fieldname = ls_good-fieldname
i_row_id = ls_good-row_id.
error_in_data = 'X'.
ELSE.
ls_good-value = l_matnr.
APPEND ls_good TO lt_good_cells.
ENDIF.
ENDCASE.
ENDLOOP.
LOOP AT lt_good_cells INTO ls_good.
l_matnr = ls_good-value.
READ TABLE i_rosi WITH KEY matnr = l_matnr
TRANSPORTING NO FIELDS.
IF sy-subrc = 0.
l_reentered = space.
LOOP AT pr_data_changed->mt_deleted_rows INTO l_del_row.
READ TABLE i_rosi INTO ls_rosi INDEX l_del_row-row_id.
IF sy-subrc NE 0.
MESSAGE i000(0k) WITH text-e01.
ELSEIF ls_rosi-matnr EQ ls_good-value.
l_reentered = 'X'.
ENDIF.
ENDLOOP.
IF l_reentered NE 'X'.
CALL METHOD pr_data_changed->add_protocol_entry
EXPORTING
i_msgid = '0K'
i_msgno = '000'
i_msgty = 'E'
i_msgv1 = text-m01
i_fieldname = ls_good-fieldname
i_row_id = ls_good-row_id.
error_in_data = 'X'.
ENDIF.
ENDIF.
ENDLOOP.
ENDMETHOD. "check_double_entriesHi Greg,
please check your posting in the prview tab. If the code is not formatted, you posted too much. Reduce and try again, then somebody may be willing to read.
Regards,
Clemens
Maybe you are looking for
-
My iPhone 3GS mail app not pushing gmail
My iPhone 3GS is not receiving push mail, nor can it send anything, through my gmail account. All other mail accounts work, but gmail stopped sending and receiving 4 days ago for no apparent reason. I've restarted, deleted and created a new gmail acc
-
Is there anyway to sort a shared photostream according to the person who posted to it?
The situation is, my family went to disney last month and took lots of pictures and shared them all to the same stream (iPhones and camera). I just want to import all the ones that are not mine (ie, they are not in the imported event or my own perso
-
ITunes crash on start up after upgrade to 10.7
Hi, I'm using window 7 32bit SP1 and after upgrade ITunes crash on start up. this is what i get in event viewer. Faulting application name: iTunes.exe, version: 10.7.0.21, time stamp: 0x504d85d9 Faulting module name: KERNELBASE.dll, version: 6.1.7601
-
hi everyone lost names but still have numbers please can anybody help ????????????
-
While Charging get screen of death. SHUT DOWN BY HOLDING Key
Hi This is my first time posting a question regarding my MBP a couple of time's now I've left my computer on and the charger plugged in I've left it there and instead of stopping charging when it's full I think it's not sometimes I come back and the