Monday, 29 July 2019

Excel Macro to split large files into multiple small files

If there is a scenario of migrating the data from one system to other system, the data load will be huge and while loading the huge record in CPI will lead to timeout issue/performance issue. So we would need to split up the files into several small files and then load into the system.

For this scenario, splitting the files, we use excel macro for splitting the file.

1.Open the huge data excel and save it.
2.Then Alt+F11 key - Microsoft Visual Basic Application screen opens
3. Go to Insert menu - Module, then paste the below code in the pop up screen.

Script:

Sub Test()

Dim wb As Workbook
Dim ThisSheet As Worksheet
Dim NumOfColumns As Integer
Dim RangeToCopy As Range
Dim WorkbookCounter As Integer
Dim RowsInFile
Dim Prefix As String
Application.ScreenUpdating = False


'Initialize data
Set ThisSheet = ThisWorkbook.ActiveSheet
NumOfColumns = ThisSheet.UsedRange.Columns.Count
WorkbookCounter = 1
RowsInFile = 10000 'how many rows (incl. header) in new files?
Prefix = "SCI_user_deletion_input_QA" 'prefix of the file name


For p = 1 To ThisSheet.UsedRange.Rows.Count Step RowsInFile
Set wb = Workbooks.Add


'Paste the chunk of rows for this file
Set RangeToCopy = ThisSheet.Range(ThisSheet.Cells(p, 1), ThisSheet.Cells(p + RowsInFile - 1, NumOfColumns))
RangeToCopy.Copy wb.Sheets(1).Range("A1")


'Save the new workbook, and close it

wb.SaveAs ThisWorkbook.Path & "\" & Prefix & "_" & WorkbookCounter &".csv",FileFormat:=xlCSV
wb.Close


'Increment file counter
WorkbookCounter = WorkbookCounter + 1
Next p


Application.ScreenUpdating = True
Set wb = Nothing
End Sub

---------------------------------------------------------------------------

4. Save and close it.
5. Again back to excel sheet -then press Alt+F8.

Now you can find the files in the folder. where you save the (huge data) excel.


--- If really helpful, just give some feedback ---




Tuesday, 23 July 2019

SAP Maintenance window / downtime of all Cloud application

Refer the below link to check the system distribution/ downtime of cloud application / maintenance window of

1. SAP CPI/HCI,
2. SAP C4C(Cloud for Customer)
3. SAP Ariba
4. SAP Concur
5. SAP Fieldglass
6. SAP Marketing Cloud( Hybris marketing)
7. SAP S/4 Hana Cloud
8. SAP Service Cloud
9. SAP SuccessFactors
10. SAP Integrated Busniess Planning (SAP IBP)

Check on the below link:

Click Here for SAP Cloud applications server status


Happy Learning!!!





HTTP Sender CSRF token Handling in SAP CPI

We would like to add some more authentication on the passing the message from the Sender system to CPI, so HTTP adapter is capable of handling the CSRF token at the sender side.

As this feature is not enabled for the HTTP receiver, so we can go ahead with the ODATA adapter to use this feature.

In this post, will read about fetching the CSRF token and post the data to CPI from sender system.

For the demonstration, we use POSTMAN tool as a sender system.

Step 1: Get the CSRF token by calling the CPI system

                                                       (Click to Zoom if not visible)


Step 2: POST the actual data with the CSRF token as mentioned in the below screenshot:



CPI Flow design for simple testingSimple connectivity cal made to CPI and posted the data successfully.


Happy Learning!!!





Tuesday, 9 July 2019

java.io.IOException: Remotely closed - SAP CPI

When you are facing this issue on the development phase, then it could be the minor mistake in URL as mentioned below.

If you encounter this same issue at the live scenario, then it could be the connection to the respective system is broken..Eg: No able to connect to the target system.

https://test/sap/opu/odata//SAP/test_SRV/MarketingPermissions

FYI.. Some occasions minor mistakes can happen.