Subscribe

RSS Feed (xml)

Powered By

Skin Design:
Free Blogger Skins

Powered by Blogger

Google
 
Showing posts with label SAP ABAP Issues. Show all posts
Showing posts with label SAP ABAP Issues. Show all posts

Saturday, December 31, 2011

How to Refresh SAP screen after certain action using SAP ABAP?

I have a screen with a table in it (generated with the screen painter) that shows records from a database table. The screen also has a button, which shows a popup when it's clicked. The popup has a form to add a record to the database table.
When the form is submitted the record is added to the database, but when the popup is closed, the screen that shows the database records isn't refreshed. The new record isn't shown. Any ideas how I could make the table refresh? Simply calling the screen again doesn't seem to work..
Answer:
You have to make sure that the data that you want to display is actually in the internal table that is displayed by the screen.
  • You can reread the database table or
  • append the line generated by the pop-up form to the internal table (If the line types aren't identical you will have to move the fields to a similar structure first).
If the internal table has all the data, but it still does not display in the table control, make sure that the field in the table control that has the number of lines is updated to reflect the extra line.

Friday, December 30, 2011

How to Change parameter name on screen in SAP ABAP?

I'm trying to replace the parameter name when it is showed in the screen. Any ideas how this is done? For example when I have:
PARAMETERS pa_age TYPE age_type DEFAULT '18'.
It shows pa_age on the screen. I want to change it to How old are you? or something. Any ideas?
Answer:
Via menu Goto->Text Elements->Selection Text.

Thursday, December 29, 2011

SAP ABAP Issue:how to make select option with todays date as default?

I'm trying to show todays date as the default value in a select date.
INITIALIZATION.
select-OPTIONS: so_date FOR sy-datlo.

START-OF-SELECTION.
so_date-sign = 'I'.
so_date-option = 'BT'.
so_date-low = sy-datum.
so_date-high = sy-datum.
APPEND so_date.
This isn't working though. Any ideas?
Answer:
You must set the value before START-OF_SELECTION:
select-OPTIONS: so_date FOR sy-datlo.

INITIALIZATION.
  so_date-sign = 'I'.
  so_date-option = 'EQ'.
  so_date-low = sy-datum.
  CLEAR so_date-high.
  APPEND so_date.
Did you try the easy version:
select-OPTIONS: so_date FOR sy-datlo default SY-DATUM.
I think it should work (can't test is actual).

Wednesday, December 28, 2011

SAP ABAP Issue: Where we can find the authority objects?

Any ideas where I can find a list of existing authority objects? I'm looking for the 'default' ones like S_CARRID.
Answer:
Transaction SU21. The S_CARRID object is located inside the BC_C object class.

Tuesday, December 27, 2011

SAP ABAP cProjects replication and Set task-level WBS

When creating a project in cProjects I am using BADI BADI DPR_FIN_GECCO_ATTR to manipulate the external WBS ID that is created in SAP PS.
SAP accepts the ID that I pass for the Phase level, but for the Task level SAP appends a string "/TTO" to the end of my WBS ID. Any idea why this happens and how I can get rid of it. The "/TTO" violates or masking structure in PS?

constants: lc_phase_id_ps type char30 value 'DPR_TV_PROJECT_ELEMENT_ID_PS',
           lc_task_id_co  type char30 value 'DPR_TV_PROJECT_ELEMENT_ID_CO'.

field-symbols:  type dpr_ts_project_ext,
                type dpr_ts_project_int,
                  type dpr_ts_phase_ext,
                  type dpr_ts_phase_int,
                   type dpr_ts_task_ext,
                   type dpr_ts_task_int,
                 type dpr_ts_iaom_object_attribute.

case ir_common->get_object_type( ).
  when cl_dpr_co=>sc_ot_project.
    "not doing anything with this data yet
    assign ir_project_ext->* to .
    assign ir_project_int->* to .  

  when cl_dpr_co=>sc_ot_phase.
    assign ir_attributes_ext->* to .
    assign ir_attributes_int->* to .
    read table ct_attributes assigning 
      with key data_element = lc_phase_id_ps.
    if sy-subrc = 0.
      -value = -phase_id.  "something like Z/001-001
    endif.

  when cl_dpr_co=>sc_ot_task.
    assign ir_attributes_ext->* to .
    assign ir_attributes_int->* to .
    read table ct_attributes assigning 
      with key data_element = lc_task_id_co.
    if sy-subrc = 0.
      -value = -search_field.  "something like Z/001-001-001
      "sometime after this badi call it is changed to Z/001-001-001/TTO
    endif.
endcase.
 
 
Answer:
I have found the spot where SAP changes the WBS:
In Class CL_IM_CPRO_PROJECT_LABEL method IF_EX_GCC_PS_PROJECT_LABEL~GET_WBS_ELEMENT there is the following logic:
if lv_object_type_co ne 'DPO'.
  read table attributes_of_ext_obj
       into ls_attribute
       with key data_element = 'DPR_TV_PROJECT_ELEMENT_ID_CO'.
  if sy-subrc = 0.
    if lv_object_type_co eq 'TTO' or     "Aufgabe            "H860739
       lv_object_type_co eq 'ITO'.       "Checklistenpunkt   "H860739
      concatenate ls_attribute-value                         "H860739 
                  lv_object_type_co                          "H860739
                  into ls_value.         "<<==Here it is     "H860739
      wbs_element = ls_value.                                "H860739
    else.                                                    "H860739
      wbs_element = ls_attribute-value.
    endif.                                                   "H860739
  else.
    message e013(iaom_cprojects)
      with 'DPR_TV_PROJECT_ELEMENT_ID_CO'
      raising error_occurred.
  endif.
  "...
  "... Code removed
endif.

 

Monday, December 26, 2011

SAP ABAP Issue: modal-dialog-box not working

I'm trying to call a screen as a popup. The screen type is set to Modal dialog box and I'm able to call the screen, but unable to close it. Nothing happens when I click on the little cross. The next screen is set to 0.
The screen I'm calling as a popup, doesn't contain any buttons, not any hard coded ones anyway. Any ideas what I'm doing wrong?
I'd also like the screen it returns to, to be refreshed (so it loads the PBO again). How do I do that?

EDIT

MODULE werkende_knoppen_subscreen INPUT.
  CASE ok_code.
    WHEN 'X'.
      LEAVE TO SCREEN 0.
  ENDCASE.
ENDMODULE. 
 
Answer:
You should be checking for the 'EXIT' (or, in your case for the custom close button, 'X') user command in the PAI part of your popup. For example:
MODULE user_command_0010 INPUT.
  ok = sy-ucomm.
  CLEAR sy-ucomm.
  CASE ok.
    WHEN 'EXIT' OR 'X'.
      LEAVE TO SCREEN 0.
  ENDCASE.
ENDMODULE.
 
 
 

SAP ABAP Issue: Is there a any way to find the customizing request number for a given record at a maintenance view?

In ABAP we can check the latest workbench request assigned to a given code from Utilities->Versions->Version Management menu.
Is there any similar feature to check which is the customizing request for a given record at a maintenance view (SM30) ?
ps. of course, considering that the transparent table for that given record have the delivery class E, or C, that needs the customizing request to allow the user to insert or remove the record.

Answer:

The table entries are transported as R3TR TABU or R3TR VDAT entries, while maintained via SM30. You can find these using function "Search for Objects in Request/Task", which you can find in transactions SE03 or SE09 (as described by Esti). - This way you can find all requests and tasks, which contain any entry from the table or view.
Alternatively you can look directly into DB table to find particular record directly.
You can do it following way:
  1. start transaction SE16
  2. enter the table name E071K
  3. field OBJNAME is your table
  4. field TABKEY contains the key of the record
  5. execute the selection
  6. field TRKORR then contains the request or task you are looking for...
Keep in mind that client-dependent tables start with client, and the key is concatenation of all the fields and it can contain * (star).
Example: for instance the record for company code DE01 in client 055 in table T001 has the tabkey value
055DE01
For table T001E, to transport all the entries of company code DE01 it would be then
055DE01*







SAP ABAP Cost centre and work order report issue

Im very new to abap and i was assigned to do a report on all work orders related to a cost center.Can any sap guru explain how are cost center related to work orders with the related tables.Thank you in advance.

Answer:

I will teach you how to fish, but I will not feed you.
Basically a report like this will be simple in terms of ABAP skill, that is until your asked to do something more than just pick out work orders based on Cost Center.
Internal Orders or Work Orders are all Cost Center related. Each work order created has an assigned cost center and can be found in the following tables and structure.
COEP Controlling Object: Line Items by period. This will have your Order number, item and also Cost Center.
COEJ Controlling Object: Line Items by year. This will have the same by Year.
This is a start. You can also use t-code IW39 to pull up a Work Order. Then place the cursor on the field you have in question and hit F1, then in the dialog box choose the Technical Content Icon (Wrench/Hammer). That will bring you to the technical description of the field and will have table name etc...
Happy fishing, come back with more questions after you have had a chance to look at what I gave you. Also, give us some more info on your configuration.. Do you run PM?

Thursday, December 8, 2011

SAP ABAP Smartform Print Problem

I am facing a strange issue while printing a smartform at the user location. There is a black box covering the entire lower portion of the page.In the smartform a window is placed at this position. When I delete the window and print it, the output is fine. I have checked the option of window shading color as well âs whatever color/no color I give, it doesn't make any difference.

This happens only in a certain type of printer at the user's location ând  everywhere else its fine.

Please give some pointers âs is this a printer fault or can something be changed in the smartform to solve this problem?

Ans : I think smart forms are some how printer specific, It is not a must that if tested on one printer it will work perfectly well on the other. I always face similar problems with logos coming upside down on some printers or being very faint etc.
so its usually a printer problem. Try changing the drivers of that printer especially to a lower version and see.
Your hardware team can help if not conversant

Mega Search