Quantcast
Channel: SCN : All Content - ABAP Development
Viewing all 8332 articles
Browse latest View live

How can I fill up empty fields with no_data_sign?

$
0
0

Hi everybody,

 

I have implemented a inbound interface to take over vendors by Idoc type CREMAS (basic type CREMAS05).

 

So from time to time we have the problem that some values in the target system will be overwritten by the processed IDoc because the field is empty. Some of these cases I have already handled by setting the no_data_sign (/) inside a user exit.

 

But now I want to do this for all emtpy fields (and segments) to be sure that in future this problem occurs not again.

 

My idea is to do this also inside the user exit by an dynamic look and dynamic assigment of the segment structure itself.

So each field which is empty will be filled with the no_data_sign.

 

So now I have some questions/problems:

 

1.) If really a empty field will be transfered I can not indicate this case. So is it better to do it by a conversion rule instead of a user exit?

2.) Can I mapp inside a conversion rule the source value to taget value and additional the no_data_sign as fallback? Does andybody know if this working?

3.) Is there a default function module to fill up empty idoc fields with the no_data_sign?

 

Regards and thanks in advance

Christian


Reg: FILE_GET_SIZE

$
0
0

Hi Group,

 

I want to know the size of the excel file which i am uploading to the internal table.

i am using the method file_get_size.

CALL METHOD cl_gui_frontend_services=>file_get_size

    EXPORTING

      file_name = gv_file

    IMPORTING

      file_size = gv_filesize.

the problem is for the first time the filesize is 0 the actual size is not displaying in the filesize.

What is the problem here????

thanks in advance

 

Regards,

Suganya.

FM HR_INFOTYPE_OPERATION

$
0
0

Hi all,

 

Is there any specific infotype that can be used by this FM? I used this FM 'HR_INFOTYPE_OPERATION to create entries on Infotype 0267 and it worked. However,when I used i to create an entry for Infotype 0221, it didnt work. There is no error message. Just that there no specific entry for Infotype 0221. Is the action type 'INS' not suitable?

 

For the problematic Infotype 0221, this is how I use the FM,

 

CONSTANTS: insert TYPE pspar-actio VALUE 'INS'.

 

DATA pernr                TYPE pa0001-pernr.

DATA p_record_0221        TYPE p0221.

DATA return_struct        TYPE bapireturn1.

DATA personaldatakey      TYPE bapipakey.

 

p_record_0221-pernr          = pernr.

  p_record_0221-subty          = 'ADJT'.

  p_record_0221-begda          = sy-datum.

  p_record_0221-endda          = sy-datum.

  p_record_0221-waers          = 'USD'.

  p_record_0221-lga01          = '6000'.

  p_record_0221-bet01          = '2525.88'.

  p_record_0221-ocrsn          = 'MPAY'.

  p_record_0221-aedtm          = sy-datum. " changed on

  p_record_0221-uname          = sy-uname. " changed by

  p_record_0221-payty          = py_type.

 

CALL FUNCTION 'HR_EMPLOYEE_ENQUEUE'

  EXPORTING

    number = pernr.

 

  CALL FUNCTION 'HR_INFOTYPE_OPERATION'

    EXPORTING

      infty         = '0221'

      subtype       = p_record_0221-subty

      number        = p_record_0221-pernr     "employeenumber

      validityend   = p_record_0221-endda

      validitybegin = p_record_0221-begda

      record        = p_record_0221

      operation     = insert

      nocommit      = 'X'

      dialog_mode   = '1'

    IMPORTING

      return        = return_struct

      key           = personaldatakey

    EXCEPTIONS

      OTHERS        = 0.

 

CALL FUNCTION 'HR_EMPLOYEE_DEQUEUE'

  EXPORTING

    number = pernr.

error message "me083" using "BAPI_PR_CHANGE"

$
0
0

Hi,

 

I´m trying to change a purchase requisition using BAPI_PR_CHANGE but i always got the error message me083 "Enter Cost Center". This requisition was created using BAPI_REQUISITION_CREATE.

 

I already have populatted the costcenter on the praccount tables.

 

Any ideias?

 

Thks

Paulo Paixã

 

How to convert custom selection under FPCOPARA User Parameters to a range table in ABAP?

$
0
0

Hi,

 

We have multiple FPCOPARA print runs with different custom selection set up under User Parameters/Custom selection. In event 1799, I need to capture whether a specific field was used for the selection or not, and I also need the values that were set up for that specific field. This selection can be either include or exclude, EQ or BT, etc, like in a usual SELECT-OPTION. I have found that all custom selection fields and their content is stored in a deep structure referring to FKK_MAD_TEXPRL. Below is one example of this but the setup is very different for each print run:

LOGOPARITYFIELDNAMEOPTIONLOWHIGH
AND4
NOT1
OR3
0VTREFEQC43289875
0VTREFEQC510399444
0VTREFEQC88411234
0FORMKEY_RDIEQZBLF_PR_INV
0COIDTBT2015100720151007
0CORR_ROLEEQZINV

Is there an FM that breaks this down into a simple SELECT_OPTION-like table for just one field? Or is there any other way to filter out the selection for one field only?

 

Thanks a lot!

Marta

Line Feed and Carriage Return

$
0
0

Hi,

 

 

We have a requirement where we generate text files in a specified structure.

While creating the files in SAP, at the end of every record CRLF gets added by default. ‘OPEN DATASET’ has been used for creating the files. These files are sent by our customer to  other parties, the expectation is, there should be no CRLF at the end of the record. We need to add a linefeed at the end of every record.

 

We have tried using attributes NewLine and CRLF of the class cl_abap_char_utilities but their hex equivalent comes out to be ‘0d0a’ and the client expectation is to be ‘0a’. Please let us know if somebody has worked on similar requirement.

 

 

Thanks

Jitender

How to simulate ATP check in user exit

$
0
0

Dear Expert,

 

as we konw, when we change so item requirement type, the ATP checking rule will be re-determined. see below:

change requiremennt from ZJ1->ZJ0, checking rule is changed from AE->A.

1.PNG

2015-12-18_083924.PNG2015-12-18_083935.PNG

 

My problem is: if i set requirement type = ZJ0 in user exit :  userexit_move_field_to_vbap.

 

but the checking rule is still AE, could you please help on this? Thanks a lot.

Question with the BAPI of bapi_contract_change

$
0
0

   I wanna to use the bapi of bapi_contract_change to change the conditions of a purchase contract, and the bapi return a error message "Activation setting not yet maintained". the error message id is 'R11', and number is "348". As the same contract, there was no error message with BDC. The data filled is :

  CLEAR:gt_item_cond_v, gt_item_cond_vx,

              gt_item_cond, gt_item_condx.

  gt_item_cond_v-item_no    = wa_ekpo-ebelp.

  gt_item_cond_v-serial_id  = wa_ekpo-ebelp.

  gt_item_cond_v-valid_from = wa_ekpo-kdatb.

  gt_item_cond_v-valid_to   = wa_ekpo-kdate.

  APPEND gt_item_cond_v.

 

  gt_item_cond_vx-item_no    = wa_ekpo-ebelp.

  gt_item_cond_vx-serial_id  = wa_ekpo-ebelp.

  gt_item_cond_vx-serial_idx = con_yes.

  gt_item_cond_vx-item_nox   = con_yes.

  gt_item_cond_vx-valid_from = con_yes.

  APPEND gt_item_cond_vx.

 

  gt_item_cond-item_no     = wa_ekpo-ebelp.

  gt_item_cond-serial_id   = wa_ekpo-ebelp.

  gt_item_cond-cond_count  = 1.

  gt_item_cond-cond_value  = wa_ekpo-netpr.

  gt_item_cond-currency    = wa_ekko-waers.

  gt_item_cond-cond_p_unt  = wa_ekpo-peinh.

  gt_item_cond-cond_unit   = wa_ekpo-meins.

  gt_item_cond-numerator   = 1.

  gt_item_cond-denominator = 1.

  gt_item_cond-cond_type   = 'PB00'.

  gt_item_cond-change_id   = 'I'.

  APPEND gt_item_cond.

 

  gt_item_condx-item_no     = wa_ekpo-ebelp.

  gt_item_condx-serial_id   = wa_ekpo-ebelp.

  gt_item_condx-cond_count  = 1.

  gt_item_condx-item_nox    = con_yes.

  gt_item_condx-serial_idx  = con_yes.

  gt_item_condx-cond_countx = con_yes.

  gt_item_condx-cond_value  = con_yes.

  gt_item_condx-currency    = con_yes.

  gt_item_condx-cond_p_unt  = con_yes.

  gt_item_condx-cond_unit   = con_yes.

  gt_item_condx-numerator   = con_yes.

  gt_item_condx-denominator = con_yes.

  gt_item_condx-cond_type   = con_yes.

  APPEND gt_item_condx.


BP role and screen config

$
0
0

Hi all,

 

I have a question for BP role.

As known, when you choose different BP roles, the screen display will also be different.

 

I found this in the SPRO. I think the interface control define the subscreens that will display.

How can I find the configuration of that?

BP.png

How to see the log of incoming data as part of webservice

$
0
0

Hi Experts

 

 

 

We have a webservice based interface to get the sales orders data, this was created by exposing a RFC as a webservice.

 

For error analysis, is the way to store the incoming data for some days?

 

explored the options of Logs Configuration little bit but could not able to achieve yet.

 

Is there any steps to follow? Is there any settings needed? Please help.

 

Thanks

Madhu

SmartForms displaying information in windows.

$
0
0

Hello all,

I am creating a smartform for a certified payroll. My question is how can I display multiple  employees on the same page? For example I am importing 5 tables: table 1 is a list of all the employees and their employee number, 2 table is all the hours for each employee, 3 table is all the taxes for each employee,  table withholdings for each employee and so on... I have different windows that I want each table to go in and repeat that for each employee.

How can this be done? Any help would be great.

User Exit or Badi for IW32 with AUDISP field in Component table

$
0
0

Hi.

 

I need user exit or BADI for IW32 with AUDISP field in Component table (type RESB),

I try to use the BAPI  Workorder_update, method Before_update, butit does not havethis field.

 

Thanks

 

Best regards,

Marie Schonbuch

Commit problem with BAPI_ENTRYSHEET_CREATE

$
0
0

I am using two BAPIs to generate data in SAP.  BAPI_CATIMESHEETMGR_INSERT following by BAPI_ENTRYSHEET_CREATE.  The first step to create time entries and the second step to generate the costs.

 

The logic is to run

 

BAPI_CATIMESHEETMGR_INSERT

 

then

 

BAPI_ENTRYSHEET_CREATE

 

then

 

If success for both

        BAPI_TRANSACTION_COMMIT

Else

     BAPI_TRANSACTION_ROLLBACK

Endif.

 

The CATS BAPI runs successfully but we get an error in the ENTRYSHEET BAPI so the ROLLBACK is called.  The error itself is fine as an invalid g/l account is being passed in some instances and the BAPI handles this correct and reports the error correctly.

 

Unfortunately the CATS entries remain in SAP ... they have been committed although no commit was performed by the code.

 

Upon further investigation I am finding that the ENTRYSHEET BAPI is performing a commit although parameter NO_COMMIT = 'X' is being passed and the BAPI is returning an error so shouldn't post.

 

If I step through the entry sheet BAPI it is calling   FUNCTION 'MS_CREATE_SERVICE_ENTRY_MULTI' after stepping over this FM the CATS entry is committed in the system.

 

Wondering if anyone has come across this issue before ... seems quite recent as the program described above has been in production for 5 years.  Want to avoid another long night of stepping through ABAP code.

 

Thanks a bunch

 

 

Stewart

Clear Entry In Smartforms

$
0
0

Hi guys, can anyone help me please.

I 've made a custom report from SAP.

output like this.

form.jpg

And my headoffice want the red ellips show just one line, cause it same.

How to solve guys?

Thanks

Read_text problem

$
0
0

HI,

 

I was using read_text to read the text of inforecord. there are 2 types- info memo and purchase order text. While i was getting info memo text using read_text, the other one was not being populated. When I debugged the standard, i saw the standard was also using read_text. That means that the standard screen shows the text but i ma not able to fetch the text using the same function module. So, i check the header of the text. It was showing created by someone else. when i made a small change and tried to read_text again, since now the text was changed by me, it came into my buffer, i was able to read it.

 

Does anyone know of some trick to fetch texts in such cases when they are stored in some other pool/buffer.

 

Thanks in advance.


Field not allowed for selection criteria

$
0
0

Hi ,

I am using a BOR object to test GETLIST for fixed asset. In it I get a selection criteria wherein i provide data to restrict the number of records it populates, and i get an error 'Field not allowed for selection criteria'. What is the reason behind this error if the selection criteria is added in this method to restrict data and i am not able to add this.

Update release order va01 based on contract va41

$
0
0

Hi Experts,

 

I have a requirement where there is a checkbox (custom) in the tab Additional data A in VA41. If the user unchecks this and saves the contract, the change should also be reflected in the corresponding release documents of this contract. I have found user exit USEREXIT_SAVE_DOCUMENT_PREPARE.

 

I want to know how to achieve this. How will the data be linked between contract and release order.

 

Please advise.

Structure used for Pricing Condition in user exit 'MV45AFZZ', T.Code Va01, Va02

$
0
0


Hi,

 

I want to make some restrictions on VAT, CST ad Excise duty on Condition tab of Sale order creation and change in VA01 and VA03.

 

I couldn't get the structure that hold all these pricing conditions in user exit MV45AFZZ.

 

Please guide me if I'm wrong to use this user exit for Pricing condition and help me to solve it, please

Identify invoice header texts in runtime before document saved

$
0
0

Hello ABAP GURU's    

 

User enters header texts in invoice using transaction VF02. We need to find those texts in runtime of program before invoice saves.Because we need to fill VBRK field with serial number when texts are entered.

 

When user re-enter or changes those header texts in the same object 2nd time, then we need to compare this texts with first time entered text to know whether text changed or new text entered. When we find texts are entered or changed 2nd time, then we need to fill VBRK table field with next number from series of serial numbers.

 

Here the question is, where do we find entered header texts in runtime of program before document saved? which part of program code/BADI/exit/BAPI carriers these texts in runtime?

What is the variable/internal table/workarea/field which carries these header texts in runtime?

 

Thanks in advance.

How to check authorization for the batch-management tick in MM01

$
0
0

I have a requirement, to check the authority for the batch-management tick field, in MM01, in the purchasing view. I have a created a custom authority object to check the user authority based on the plant. As soon as, the user going to change that batch-management tick, it will check his authority. It will allow to change the only if he has the authority for that particular authority object. But I haven't been able to find any suitable place to put my code. I have tried field exit, but it's not getting triggered, and later I have learned, from SCN that field-exit doesn't get triggered for checkboxes. I have tried to put code in the function module MARC_XCHPF, but it is not of any great help.

 

Kindly suggest me the possible solution to this problem.

 

Thanks in anticipation

Viewing all 8332 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>